Uploaded image for project: 'Spring Roo'
  1. Spring Roo
  2. ROO-3712

Generate repositories for readOnly and readAndWrite entities

    XMLWordPrintable

Details

    • New Feature
    • Status: Resolved
    • Minor
    • Resolution: Complete
    • 2.0.0.M1
    • 2.0.0.M2
    • 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.

      Attachments

        Activity

          People

            jcgarcia Juan Carlos García del Canto
            jcgarcia Juan Carlos García del Canto
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: