Interface PersistenceProvider<E>

All Known Implementing Classes:
PersistenceProviderImpl

public interface PersistenceProvider<E>
  • Method Summary

    Modifier and Type
    Method
    Description
    <T> javax.persistence.TypedQuery<T>
    createQuery(javax.persistence.criteria.CriteriaQuery<T> criteriaQuery)
    Creates a query from the given CriteriaQuery.
    void
    delete(E entity)
    Deletes the entity from the current session.
    get(Long id)
    Retrieves the entity with the given id from the current session.
    javax.persistence.criteria.CriteriaBuilder
    Returns the CriteriaBuilder for the current session.
    persist(E entity)
    Performs a saveOrUpdate in the current session.
    void
    update(E entity)
    Updates the entity in the current session.
  • Method Details

    • persist

      E persist(E entity)
      Performs a saveOrUpdate in the current session.
      Parameters:
      entity - the entity to persist
      Returns:
      the persisted entity
    • update

      void update(E entity)
      Updates the entity in the current session.
      Parameters:
      entity - the entity to update
    • delete

      void delete(E entity)
      Deletes the entity from the current session.
      Parameters:
      entity - the entity to delete
    • get

      E get(Long id)
      Retrieves the entity with the given id from the current session.
      Parameters:
      id - the id of the entity to retrieve
      Returns:
      the entity
    • getCriteriaBuilder

      javax.persistence.criteria.CriteriaBuilder getCriteriaBuilder()
      Returns the CriteriaBuilder for the current session.
      Returns:
      the CriteriaBuilder
    • createQuery

      <T> javax.persistence.TypedQuery<T> createQuery(javax.persistence.criteria.CriteriaQuery<T> criteriaQuery)
      Creates a query from the given CriteriaQuery.
      Parameters:
      criteriaQuery - the CriteriaQuery to create a query from
      Returns:
      the query