Class GenericHbmDAO<T,PK extends Serializable>

java.lang.Object
org.europa.together.application.GenericHbmDAO<T,PK>
Type Parameters:
T - as template.
PK - as PrimaryKey
All Implemented Interfaces:
Serializable, GenericDAO<T,PK>
Direct Known Subclasses:
ConfigurationHbmDAO

@Repository @Transactional public abstract class GenericHbmDAO<T,PK extends Serializable> extends Object implements GenericDAO<T,PK>
Abstract implementation of Domain Access Object (DAO) Pattern.
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    jakarta.persistence.EntityManager
    JPA Entity Manager for Transactions.

    Fields inherited from interface org.europa.together.business.GenericDAO

    FEATURE_ID
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    Count the entries of corresponding table to the domain object is specialized in the DAO.
    boolean
    create(T object)
    Persist a new entity and return TRUE if it was successful.In the case that the entity is already existing or the persist project is not a valid entity the method return FALSE.
    void
    delete(PK id)
    Search for an persistent entity.If it's already existent then it will be delete, otherwise a EntityNotFoundException will thrown.
    Tries to create from a collection of JSON objects a list of enties.
    Tried to create a entity object from a given JSON String.
    find(PK id)
    Try to find a persited domain object.
    Get the primary key of the DAO entity.
    Get all persited entries of an entity as list.
    Check if the entity is not NULL and try to create a JSON object as String, otherwise the String will be empty.
    void
    update(PK id, T object)
    Search an entity in the persistence context and update it.If it's not exist a EntityNotFoundException will thrown.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait