Class BaseRepository<E extends BaseEntity>

java.lang.Object
projectplayground.repositories.BaseRepository<E>

public abstract class BaseRepository<E extends BaseEntity>
extends java.lang.Object
  • Field Summary

    Fields
    Modifier and Type Field Description
    protected javax.persistence.EntityManager entityManager  
    private java.lang.Class<E> type  
  • Constructor Summary

    Constructors
    Constructor Description
    BaseRepository()  
  • Method Summary

    Modifier and Type Method Description
    void delete​(E entity)  
    void deleteAll()  
    java.util.List<E> findAll()  
    java.util.Optional<E> findBy​(java.lang.Long id)  
    java.lang.Long save​(E entity)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • entityManager

      protected final javax.persistence.EntityManager entityManager
    • type

      private final java.lang.Class<E extends BaseEntity> type
  • Constructor Details

    • BaseRepository

      public BaseRepository()
  • Method Details

    • save

      public java.lang.Long save​(E entity)
    • findBy

      public java.util.Optional<E> findBy​(java.lang.Long id)
    • findAll

      public java.util.List<E> findAll()
    • delete

      public void delete​(E entity)
    • deleteAll

      public void deleteAll()