How to extend RepositoryDefinition annotation in spring data?

579 views Asked by At

As we know, there is two ways to define a repository in Spring data. one is extending an interface (for example own JpaRepository) and the second one is using RepositoryDefinition annotation. I've extended JpaRepository and created my own interface that repositories extend it. and with my own RepositoryFactoryBean, I can decide that what implementation should be inject as repositories in spring context. for example you can see this http://docs.spring.io/spring-data/jpa/docs/1.4.3.RELEASE/reference/html/repositories.html#d0e720

for example :

public interface DepartmentRepository extends SwiftRepository<DepartmentEntity,java.lang.Long> {

}

My question is how can I change this way to use annotation based repository definition?

For example something like this:

@MyOwmRepository(domainClass=DepartmentEntity.class,idClass=Long.class)
public interface DepartmentRepository {

}
0

There are 0 answers