Create fully customized spring-data repositories, allowing custom code to be used with spring-data-rest etc.
- Enable custom repositories (
@EnableCustomRepositories
) - Annotate eligible entities (
@Custom
) - Create a repository (extend
CustomRepository<T, ID>
) - Add custom behavior:
- Let repository extend a new interface with the
Custom
suffix - Create an implementation of the new interface with the
Impl
prefix - Add one or more CRUD methods named
findOne
,save
,findAll
,delete
(seeDefaultCrudMethods
) - Add query methods annotated with
@Query
- Export repository using
spring-data-rest
<dependency>
<groupId>at.molindo</groupId>
<artifactId>spring-data-custom</artifactId>
<version>0.0.1</version>
</dependency>