Class ResourcesHbmDAO

java.lang.Object
org.europa.together.application.GenericHbmDAO<ResourcesDO,String>
org.europa.together.application.acl.ResourcesHbmDAO
All Implemented Interfaces:
Serializable, ResourcesDAO, org.europa.together.business.GenericDAO<ResourcesDO,String>

@Repository @Transactional public class ResourcesHbmDAO extends org.europa.together.application.GenericHbmDAO<ResourcesDO,String> implements ResourcesDAO
Implementation of the ResourcesDAO.
See Also:
  • Field Summary

    Fields inherited from class org.europa.together.application.GenericHbmDAO

    mainEntityManagerFactory

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

    FEATURE_ID
  • Constructor Summary

    Constructors
    Constructor
    Description
    Default Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    delete(String resourceID)
    Deprecated.
    boolean
    delete(ResourcesDO resource)
    If the resource object exist in the persistence context and is not protected, it will be deleted.
    find(String resource)
     
    find(String resource, String view)
    Fetch a specific resource defined by the resource name and the view.
    Return a list of all resources which protected against deleting, to prevent accidents.
    Fetch a list of resources with the same name.
    void
    update(String id, ResourcesDO object)
    Deprecated.
    void
    update(ResourcesDO resource)
    Overwrite the regular DAO update method, because of composite Primary Key.

    Methods inherited from class org.europa.together.application.GenericHbmDAO

    countAllElements, create, deserializeJsonAsList, deserializeJsonAsObject, getPrimaryKeyOfObject, listAllElements, serializeAsJson

    Methods inherited from class java.lang.Object

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

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

    countAllElements, create, deserializeJsonAsList, deserializeJsonAsObject, getPrimaryKeyOfObject, listAllElements, serializeAsJson
  • Constructor Details

    • ResourcesHbmDAO

      public ResourcesHbmDAO()
      Default Constructor.
  • Method Details

    • update

      @Deprecated public void update(String id, ResourcesDO object)
      Deprecated.
      Specified by:
      update in interface org.europa.together.business.GenericDAO<ResourcesDO,String>
      Overrides:
      update in class org.europa.together.application.GenericHbmDAO<ResourcesDO,String>
    • delete

      @Deprecated public void delete(String resourceID)
      Deprecated.
      Specified by:
      delete in interface org.europa.together.business.GenericDAO<ResourcesDO,String>
      Overrides:
      delete in class org.europa.together.application.GenericHbmDAO<ResourcesDO,String>
    • find

      @Transactional(readOnly=true) public ResourcesDO find(String resource)
      Specified by:
      find in interface org.europa.together.business.GenericDAO<ResourcesDO,String>
      Overrides:
      find in class org.europa.together.application.GenericHbmDAO<ResourcesDO,String>
    • find

      @Transactional(readOnly=true) public ResourcesDO find(String resource, String view)
      Description copied from interface: ResourcesDAO
      Fetch a specific resource defined by the resource name and the view.
      Specified by:
      find in interface ResourcesDAO
      Parameters:
      resource - as String
      view - as String
      Returns:
      ResourceDo as Object
    • update

      public void update(ResourcesDO resource) throws jakarta.persistence.EntityNotFoundException
      Description copied from interface: ResourcesDAO
      Overwrite the regular DAO update method, because of composite Primary Key.
      Specified by:
      update in interface ResourcesDAO
      Parameters:
      resource - as ResourceDO
      Throws:
      jakarta.persistence.EntityNotFoundException
    • delete

      public boolean delete(ResourcesDO resource) throws jakarta.persistence.EntityNotFoundException
      Description copied from interface: ResourcesDAO
      If the resource object exist in the persistence context and is not protected, it will be deleted.
      Specified by:
      delete in interface ResourcesDAO
      Parameters:
      resource - as ResourceDO
      Returns:
      true on success
      Throws:
      jakarta.persistence.EntityNotFoundException
    • listResourcesOfSameType

      @Transactional(readOnly=true) public List<ResourcesDO> listResourcesOfSameType(String resource)
      Description copied from interface: ResourcesDAO
      Fetch a list of resources with the same name. A system could contain multiply resources with the same name. To distinguish this resources a view is defined. The default entry for views is default.
      Specified by:
      listResourcesOfSameType in interface ResourcesDAO
      Parameters:
      resource - as string
      Returns:
      List of ResourcesDO
    • listProtectedResources

      @Transactional(readOnly=true) public List<ResourcesDO> listProtectedResources()
      Description copied from interface: ResourcesDAO
      Return a list of all resources which protected against deleting, to prevent accidents.
      Specified by:
      listProtectedResources in interface ResourcesDAO
      Returns:
      List of ResourcesDO