DATACMNS-944 - Moved to more consistent naming scheme for CrudRepository methods.
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(…)
That results in the following renames:
* findOne(…) -> findById(…)
* save(Iterable) -> saveAll(Iterable)
* findAll(Iterable<ID>) -> findAllById(…)
* delete(ID) -> deleteById(ID)
* delete(Iterable<T>) -> deleteAll(Iterable<T>)
* exists() -> existsById(…)
As a side-effect of that, we can now drop the Serializable requirement for identifiers.
Updated CRUD method detection to use the new naming scheme and moved the code to Java 8 streams and Optional. Adapted RepositoryInvoker API to reflect method name changes as well.
@ -114,20 +113,20 @@ public class QuerydslRepositoryInvokerAdapter implements RepositoryInvoker {
@@ -114,20 +113,20 @@ public class QuerydslRepositoryInvokerAdapter implements RepositoryInvoker {
@ -33,7 +31,7 @@ public class AnnotationRepositoryMetadata extends AbstractRepositoryMetadata {
@@ -33,7 +31,7 @@ public class AnnotationRepositoryMetadata extends AbstractRepositoryMetadata {
privatestaticfinalStringNO_ANNOTATION_FOUND=String.format("Interface must be annotated with @%s!",
RepositoryDefinition.class.getName());
privatefinalClass<?extendsSerializable>idType;
privatefinalClass<?>idType;
privatefinalClass<?>domainType;
/**
@ -56,7 +54,7 @@ public class AnnotationRepositoryMetadata extends AbstractRepositoryMetadata {
@@ -56,7 +54,7 @@ public class AnnotationRepositoryMetadata extends AbstractRepositoryMetadata {
@ -69,7 +67,7 @@ public class AnnotationRepositoryMetadata extends AbstractRepositoryMetadata {
@@ -69,7 +67,7 @@ public class AnnotationRepositoryMetadata extends AbstractRepositoryMetadata {
@ -79,18 +83,12 @@ public class DefaultCrudMethods implements CrudMethods {
@@ -79,18 +83,12 @@ public class DefaultCrudMethods implements CrudMethods {
@ -98,25 +96,28 @@ public class DefaultCrudMethods implements CrudMethods {
@@ -98,25 +96,28 @@ public class DefaultCrudMethods implements CrudMethods {
@ -130,49 +131,37 @@ public class DefaultCrudMethods implements CrudMethods {
@@ -130,49 +131,37 @@ public class DefaultCrudMethods implements CrudMethods {
@ -186,10 +175,10 @@ public class DefaultCrudMethods implements CrudMethods {
@@ -186,10 +175,10 @@ public class DefaultCrudMethods implements CrudMethods {
@ -263,4 +252,8 @@ public class DefaultCrudMethods implements CrudMethods {
@@ -263,4 +252,8 @@ public class DefaultCrudMethods implements CrudMethods {
@ -39,7 +38,7 @@ public class DefaultRepositoryMetadata extends AbstractRepositoryMetadata {
@@ -39,7 +38,7 @@ public class DefaultRepositoryMetadata extends AbstractRepositoryMetadata {
privatestaticfinalStringMUST_BE_A_REPOSITORY=String.format("Given type must be assignable to %s!",
Repository.class);
privatefinalClass<?extendsSerializable>idType;
privatefinalClass<?>idType;
privatefinalClass<?>domainType;
/**
@ -56,8 +55,7 @@ public class DefaultRepositoryMetadata extends AbstractRepositoryMetadata {
@@ -56,8 +55,7 @@ public class DefaultRepositoryMetadata extends AbstractRepositoryMetadata {
@ -66,10 +64,10 @@ public class DefaultRepositoryMetadata extends AbstractRepositoryMetadata {
@@ -66,10 +64,10 @@ public class DefaultRepositoryMetadata extends AbstractRepositoryMetadata {
thrownewIllegalArgumentException(String.format("Could not resolve id type of %s!",repositoryInterface));
@ -90,7 +90,7 @@ public class EventPublishingRepositoryProxyPostProcessor implements RepositoryPr
@@ -90,7 +90,7 @@ public class EventPublishingRepositoryProxyPostProcessor implements RepositoryPr
@ -42,7 +40,7 @@ public class PersistableEntityInformation<T extends Persistable<ID>, ID extends
@@ -42,7 +40,7 @@ public class PersistableEntityInformation<T extends Persistable<ID>, ID extends
@ -291,7 +290,7 @@ public abstract class RepositoryFactorySupport implements BeanClassLoaderAware,
@@ -291,7 +290,7 @@ public abstract class RepositoryFactorySupport implements BeanClassLoaderAware,
@ -100,11 +99,10 @@ public class DefaultRepositoryInvokerFactory implements RepositoryInvokerFactory
@@ -100,11 +99,10 @@ public class DefaultRepositoryInvokerFactory implements RepositoryInvokerFactory
@ -49,12 +48,12 @@ public class Repositories implements Iterable<Class<?>> {
@@ -49,12 +48,12 @@ public class Repositories implements Iterable<Class<?>> {
@ -148,12 +147,12 @@ public class Repositories implements Iterable<Class<?>> {
@@ -148,12 +147,12 @@ public class Repositories implements Iterable<Class<?>> {
@ -173,7 +172,7 @@ public class Repositories implements Iterable<Class<?>> {
@@ -173,7 +172,7 @@ public class Repositories implements Iterable<Class<?>> {
@ -191,7 +190,7 @@ public class Repositories implements Iterable<Class<?>> {
@@ -191,7 +190,7 @@ public class Repositories implements Iterable<Class<?>> {
@ -264,12 +263,12 @@ public class Repositories implements Iterable<Class<?>> {
@@ -264,12 +263,12 @@ public class Repositories implements Iterable<Class<?>> {
@ -86,11 +86,11 @@ public class QuerydslRepositoryInvokerAdapterUnitTests {
@@ -86,11 +86,11 @@ public class QuerydslRepositoryInvokerAdapterUnitTests {
@ -61,7 +60,7 @@ public class DummyRepositoryFactory extends RepositoryFactorySupport {
@@ -61,7 +60,7 @@ public class DummyRepositoryFactory extends RepositoryFactorySupport {
@ -36,7 +35,7 @@ public final class DummyRepositoryInformation implements RepositoryInformation {
@@ -36,7 +35,7 @@ public final class DummyRepositoryInformation implements RepositoryInformation {
@ -122,7 +122,7 @@ public class EventPublishingRepositoryProxyPostProcessorUnitTests {
@@ -122,7 +122,7 @@ public class EventPublishingRepositoryProxyPostProcessorUnitTests {
@ -164,7 +164,7 @@ public class EventPublishingRepositoryProxyPostProcessorUnitTests {
@@ -164,7 +164,7 @@ public class EventPublishingRepositoryProxyPostProcessorUnitTests {
@ -59,10 +60,10 @@ public class ReactiveWrapperRepositoryFactorySupportUnitTests {
@@ -59,10 +60,10 @@ public class ReactiveWrapperRepositoryFactorySupportUnitTests {
@ -70,10 +71,10 @@ public class ReactiveWrapperRepositoryFactorySupportUnitTests {
@@ -70,10 +71,10 @@ public class ReactiveWrapperRepositoryFactorySupportUnitTests {
@ -83,9 +84,9 @@ public class ReactiveWrapperRepositoryFactorySupportUnitTests {
@@ -83,9 +84,9 @@ public class ReactiveWrapperRepositoryFactorySupportUnitTests {
@ -93,9 +94,9 @@ public class ReactiveWrapperRepositoryFactorySupportUnitTests {
@@ -93,9 +94,9 @@ public class ReactiveWrapperRepositoryFactorySupportUnitTests {
@ -104,36 +105,36 @@ public class ReactiveWrapperRepositoryFactorySupportUnitTests {
@@ -104,36 +105,36 @@ public class ReactiveWrapperRepositoryFactorySupportUnitTests {
@ -59,9 +59,9 @@ public class DefaultRepositoryInvokerFactoryIntegrationTests {
@@ -59,9 +59,9 @@ public class DefaultRepositoryInvokerFactoryIntegrationTests {