Details
-
New Feature
-
Status: Resolved
-
Minor
-
Resolution: Complete
-
2.0.0.M1
-
None
-
None
Description
When developer tries to generate new repository using repository commands, he needs to define for which entity wants to generate the repository.
Take in mind that this entity could be "readOnly" or "readAndWrite":
- ReadOnly entities:
- Roo generates an interface EntityCustomRepository to include dynamic queries.
- Roo creates an empty implementation of previous interface that extends of QueryDslRepositorySupport.
- Roo generates an interface called ReadOnlyRepository that extends Repository like the following:
@NoRepositoryBean @Transactional(readOnly = true) public interface ReadOnlyRepository<T, ID extends Serializable> extends Repository<T, ID> { T findOne(ID id); boolean exists(ID id); List<T> findAll(); List<T> findAll(Iterable<ID> ids); long count(); List<T> findAll(Sort sort); Page<T> findAll(Pageable pageable); T getOne(ID id); }
- Roo creates an interface that extends interface EntityCustomRepository and ReadOnlyRepository. Will be annotated with @RooRepository
- "ReadAndWrite" entities:
- Roo generates an interface EntityCustomRepository to include dynamic queries.
- Roo creates an empty implementation of previous interface that extends of QueryDslRepositorySupport.
- Roo generates an interface that extends EntityCustomRepository and JpaRepository. Will be annotated with @RooRepository.