DATAREDIS-640 - Adapt to API changes in repository interfaces.
We now follow a more consistent naming scheme for the methods in repository that are driven by the following guidelines: * Methods referring to an identifier now all end on …ById(…). * Methods taking or returning a collection are named …All(…) Please see DATACMNS-944 for details.
This commit is contained in:
committed by
Oliver Gierke
parent
abea6fdef2
commit
00c433c74f
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -15,23 +15,21 @@
|
||||
*/
|
||||
package org.springframework.data.redis.repository.core;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.springframework.data.mapping.model.MappingException;
|
||||
import org.springframework.data.redis.core.mapping.RedisPersistentEntity;
|
||||
import org.springframework.data.repository.core.support.PersistentEntityInformation;
|
||||
|
||||
/**
|
||||
* {@link RedisEntityInformation} implementation using a {@link MongoPersistentEntity} instance to lookup the necessary
|
||||
* {@link RedisEntityInformation} implementation using a {@link RedisPersistentEntity} instance to lookup the necessary
|
||||
* information. Can be configured with a custom collection to be returned which will trump the one returned by the
|
||||
* {@link MongoPersistentEntity} if given.
|
||||
* {@link RedisPersistentEntity} if given.
|
||||
*
|
||||
* @author Christoph Strobl
|
||||
* @param <T>
|
||||
* @param <ID>
|
||||
*/
|
||||
public class MappingRedisEntityInformation<T, ID extends Serializable>
|
||||
extends PersistentEntityInformation<T, Serializable> implements RedisEntityInformation<T, Serializable> {
|
||||
public class MappingRedisEntityInformation<T, ID> extends PersistentEntityInformation<T, ID>
|
||||
implements RedisEntityInformation<T, ID> {
|
||||
|
||||
private final RedisPersistentEntity<T> entityMetadata;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -15,8 +15,6 @@
|
||||
*/
|
||||
package org.springframework.data.redis.repository.core;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.springframework.data.repository.core.EntityInformation;
|
||||
|
||||
/**
|
||||
@@ -24,6 +22,6 @@ import org.springframework.data.repository.core.EntityInformation;
|
||||
* @param <T>
|
||||
* @param <ID>
|
||||
*/
|
||||
public interface RedisEntityInformation<T, ID extends Serializable> extends EntityInformation<T, ID> {
|
||||
public interface RedisEntityInformation<T, ID> extends EntityInformation<T, ID> {
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2015-2016 the original author or authors.
|
||||
* Copyright 2015-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -15,8 +15,6 @@
|
||||
*/
|
||||
package org.springframework.data.redis.repository.support;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.springframework.data.keyvalue.core.KeyValueOperations;
|
||||
import org.springframework.data.keyvalue.repository.query.KeyValuePartTreeQuery;
|
||||
import org.springframework.data.keyvalue.repository.support.KeyValueRepositoryFactory;
|
||||
@@ -77,7 +75,7 @@ public class RedisRepositoryFactory extends KeyValueRepositoryFactory {
|
||||
*/
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public <T, ID extends Serializable> EntityInformation<T, ID> getEntityInformation(Class<T> domainClass) {
|
||||
public <T, ID> EntityInformation<T, ID> getEntityInformation(Class<T> domainClass) {
|
||||
|
||||
RedisPersistentEntity<T> entity = (RedisPersistentEntity<T>) operations.getMappingContext()
|
||||
.getPersistentEntity(domainClass).get();
|
||||
|
||||
Reference in New Issue
Block a user