DATACMNS-1255 - Polishing.
Add default QueryLookupStrategy key lookup method to CdiRepositoryConfiguration to not break existing modules by forcing these to implement a new method. Original pull request: #272.
This commit is contained in:
committed by
Oliver Gierke
parent
30292101e4
commit
036ccde5ce
@@ -44,7 +44,6 @@ import org.springframework.data.repository.config.CustomRepositoryImplementation
|
||||
import org.springframework.data.repository.config.DefaultRepositoryConfiguration;
|
||||
import org.springframework.data.repository.config.RepositoryBeanNameGenerator;
|
||||
import org.springframework.data.repository.config.SpringDataAnnotationBeanNameGenerator;
|
||||
import org.springframework.data.repository.query.QueryLookupStrategy;
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.ClassUtils;
|
||||
@@ -430,11 +429,5 @@ public abstract class CdiRepositoryBean<T> implements Bean<T>, PassivationCapabl
|
||||
public String getRepositoryImplementationPostfix() {
|
||||
return DefaultRepositoryConfiguration.DEFAULT_REPOSITORY_IMPLEMENTATION_POSTFIX;
|
||||
}
|
||||
|
||||
@Override
|
||||
public QueryLookupStrategy.Key getQueryLookupStrategy() {
|
||||
return DefaultRepositoryConfiguration.DEFAULT_QUERY_LOOKUP_STRATEGY;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,12 +16,14 @@
|
||||
|
||||
package org.springframework.data.repository.cdi;
|
||||
|
||||
import org.springframework.data.repository.config.DefaultRepositoryConfiguration;
|
||||
import org.springframework.data.repository.query.QueryLookupStrategy;
|
||||
|
||||
/**
|
||||
* Interface containing the configurable options for the Spring Data repository subsystem using CDI.
|
||||
*
|
||||
* @author Mark Paluch
|
||||
* @author Fabian Henniges
|
||||
*/
|
||||
public interface CdiRepositoryConfiguration {
|
||||
|
||||
@@ -32,12 +34,13 @@ public interface CdiRepositoryConfiguration {
|
||||
*/
|
||||
String getRepositoryImplementationPostfix();
|
||||
|
||||
|
||||
/**
|
||||
* Return the strategy to lookup queries
|
||||
* Return the strategy to lookup queries.
|
||||
*
|
||||
* @return the lookup strategy to use
|
||||
* @return the lookup strategy to use.
|
||||
* @since 2.1
|
||||
*/
|
||||
QueryLookupStrategy.Key getQueryLookupStrategy();
|
||||
|
||||
default QueryLookupStrategy.Key getQueryLookupStrategy() {
|
||||
return DefaultRepositoryConfiguration.DEFAULT_QUERY_LOOKUP_STRATEGY;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user