Browse Source

DATACMNS-891 - Added constructor to ease migration from Hopper to Ingalls.

RepositoryFactoryBeanSupport now declares both a default constructor as well as one taking the repository interface as argument like we're going to progress in Ingalls. This allows implementations to tweak their Hopper compatible extensions of the class to also declare both constructors. That causes them to stay compatible with Hopper (which will use the setter) but also run on Ingalls which will use constructor injection.
pull/347/head
Oliver Gierke 9 years ago
parent
commit
6df18e1438
  1. 14
      src/main/java/org/springframework/data/repository/core/support/RepositoryFactoryBeanSupport.java

14
src/main/java/org/springframework/data/repository/core/support/RepositoryFactoryBeanSupport.java

@ -67,6 +67,20 @@ public abstract class RepositoryFactoryBeanSupport<T extends Repository<S, ID>, @@ -67,6 +67,20 @@ public abstract class RepositoryFactoryBeanSupport<T extends Repository<S, ID>,
private RepositoryMetadata repositoryMetadata;
protected RepositoryFactoryBeanSupport() {}
/**
* Creates a new {@link RepositoryFactoryBeanSupport} for the given repository interface.
*
* @param repositoryInterface must not be {@literal null}.
*/
protected RepositoryFactoryBeanSupport(Class<? extends T> repositoryInterface) {
Assert.notNull(repositoryInterface, "Repository interface must not be null on initialization!");
this.repositoryInterface = repositoryInterface;
}
/**
* Setter to inject the repository interface to implement.
*

Loading…
Cancel
Save