Class VersionedJpaRepositoryImpl<T extends VersionedEntity,​K extends Serializable,​V extends VersionEntity>

  • All Implemented Interfaces:
    VersionedJpaRepository<T,​K,​V>, org.springframework.data.jpa.repository.JpaRepository<T,​K>, org.springframework.data.jpa.repository.JpaSpecificationExecutor<T>, org.springframework.data.jpa.repository.support.JpaRepositoryImplementation<T,​K>, org.springframework.data.repository.CrudRepository<T,​K>, org.springframework.data.repository.PagingAndSortingRepository<T,​K>, org.springframework.data.repository.query.QueryByExampleExecutor<T>, org.springframework.data.repository.Repository<T,​K>

    public class VersionedJpaRepositoryImpl<T extends VersionedEntity,​K extends Serializable,​V extends VersionEntity>
    extends org.springframework.data.jpa.repository.support.SimpleJpaRepository<T,​K>
    implements VersionedJpaRepository<T,​K,​V>
    Implementation for VersionedJpaRepository
    • Constructor Summary

      Constructors 
      Constructor Description
      VersionedJpaRepositoryImpl​(Class<T> versionedClass, Class<V> versionClass, javax.persistence.EntityManager entityManager)
      Creates a new SimpleJpaRepository to manage objects of the given domain type.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      <S extends T>
      S
      save​(S versionedEntity)
      Add a new version before any save.
      • Methods inherited from class org.springframework.data.jpa.repository.support.SimpleJpaRepository

        count, count, count, delete, deleteAll, deleteAll, deleteAllById, deleteAllByIdInBatch, deleteAllInBatch, deleteAllInBatch, deleteById, exists, existsById, findAll, findAll, findAll, findAll, findAll, findAll, findAll, findAll, findAll, findAllById, findBy, findById, findOne, findOne, flush, getById, getCountQuery, getCountQuery, getDomainClass, getOne, getQuery, getQuery, getQuery, getQuery, getQueryHints, getRepositoryMethodMetadata, readPage, readPage, saveAll, saveAllAndFlush, saveAndFlush, setEscapeCharacter, setRepositoryMethodMetadata
      • Methods inherited from interface org.springframework.data.repository.CrudRepository

        count, delete, deleteAll, deleteAll, deleteAllById, deleteById, existsById, findById
      • Methods inherited from interface org.springframework.data.jpa.repository.JpaRepository

        deleteAllByIdInBatch, deleteAllInBatch, deleteAllInBatch, deleteInBatch, findAll, findAll, findAll, findAll, findAllById, flush, getById, getOne, saveAll, saveAllAndFlush, saveAndFlush
      • Methods inherited from interface org.springframework.data.repository.PagingAndSortingRepository

        findAll
      • Methods inherited from interface org.springframework.data.repository.query.QueryByExampleExecutor

        count, exists, findAll, findBy, findOne
    • Constructor Detail

      • VersionedJpaRepositoryImpl

        public VersionedJpaRepositoryImpl​(Class<T> versionedClass,
                                          Class<V> versionClass,
                                          javax.persistence.EntityManager entityManager)
        Creates a new SimpleJpaRepository to manage objects of the given domain type.
        Parameters:
        versionedClass - the class of the version entity.
        versionClass - the class of the version entity.
        entityManager - must not be null.
    • Method Detail

      • save

        @Transactional
        public <S extends T> S save​(S versionedEntity)
        Add a new version before any save.
        Specified by:
        save in interface org.springframework.data.repository.CrudRepository<T extends VersionedEntity,​K extends Serializable>
        Overrides:
        save in class org.springframework.data.jpa.repository.support.SimpleJpaRepository<T extends VersionedEntity,​K extends Serializable>
        Type Parameters:
        S - the versionedEntity type
        Parameters:
        versionedEntity - the entity to save
        Returns:
        the saved entity