Interface ResourcesDAO

All Superinterfaces:
org.europa.together.business.GenericDAO<ResourcesDO,String>, Serializable
All Known Implementing Classes:
ResourcesHbmDAO

@Repository public interface ResourcesDAO extends org.europa.together.business.GenericDAO<ResourcesDO,String>
A resource is linked to a permission. This avoid duplications and simplify the administration.
Since:
1.0
Version:
1.0
Author:
elmar.dott@gmail.com
  • Field Summary

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

    FEATURE_ID
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    delete(ResourcesDO resource)
    If the resource object exist in the persistence context and is not protected, it will be deleted.
    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(ResourcesDO resource)
    Overwrite the regular DAO update method, because of composite Primary Key.

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

    countAllElements, create, delete, deserializeJsonAsList, deserializeJsonAsObject, find, getPrimaryKeyOfObject, listAllElements, serializeAsJson, update
  • Method Details

    • find

      @API(status=STABLE, since="1.0") ResourcesDO find(String resource, String view)
      Fetch a specific resource defined by the resource name and the view.
      Parameters:
      resource - as String
      view - as String
      Returns:
      ResourceDo as Object
    • update

      @API(status=STABLE, since="1.0") void update(ResourcesDO resource) throws jakarta.persistence.EntityNotFoundException
      Overwrite the regular DAO update method, because of composite Primary Key.
      Parameters:
      resource - as ResourceDO
      Throws:
      jakarta.persistence.EntityNotFoundException
    • delete

      @API(status=STABLE, since="1.0") boolean delete(ResourcesDO resource) throws jakarta.persistence.EntityNotFoundException
      If the resource object exist in the persistence context and is not protected, it will be deleted.
      Parameters:
      resource - as ResourceDO
      Returns:
      true on success
      Throws:
      jakarta.persistence.EntityNotFoundException
    • listResourcesOfSameType

      @API(status=STABLE, since="1.0") List<ResourcesDO> listResourcesOfSameType(String resource)
      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.
      Parameters:
      resource - as string
      Returns:
      List of ResourcesDO
    • listProtectedResources

      @API(status=STABLE, since="1.0") List<ResourcesDO> listProtectedResources()
      Return a list of all resources which protected against deleting, to prevent accidents.
      Returns:
      List of ResourcesDO