Class DatabaseResourceDAO

java.lang.Object
fr.paris.lutece.plugins.resource.business.database.DatabaseResourceDAO
All Implemented Interfaces:
IDatabaseResourceDAO

public class DatabaseResourceDAO extends Object implements IDatabaseResourceDAO
DAO for database resources
  • Constructor Details

    • DatabaseResourceDAO

      public DatabaseResourceDAO()
  • Method Details

    • insert

      public void insert(DatabaseResource resource, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      insert a new resource into the database
      Specified by:
      insert in interface IDatabaseResourceDAO
      Parameters:
      resource - The resource to creates
      plugin - The plugin
    • update

      public void update(DatabaseResource resource, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Updates a database resource
      Specified by:
      update in interface IDatabaseResourceDAO
      Parameters:
      resource - The resource
      plugin - The plugin
    • delete

      public void delete(int nIdResource, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Remove a resource from the database
      Specified by:
      delete in interface IDatabaseResourceDAO
      Parameters:
      nIdResource - the id of the resource
      plugin - the plugin
    • findByPrimaryKey

      public DatabaseResource findByPrimaryKey(int nIdResource, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Find a resource from its primary key
      Specified by:
      findByPrimaryKey in interface IDatabaseResourceDAO
      Parameters:
      nIdResource - the id of the resource
      plugin - The plugin
      Returns:
      The resource, or null if no resource has the given primary key
    • findAll

      public List<DatabaseResource> findAll(fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Get the list of resources
      Specified by:
      findAll in interface IDatabaseResourceDAO
      Parameters:
      plugin - the plugin
      Returns:
      The list of resources
    • findAllId

      public List<Integer> findAllId(DatabaseResourceSort resourceSort, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Get the list of resource ids
      Specified by:
      findAllId in interface IDatabaseResourceDAO
      Parameters:
      resourceSort - The sort parameters
      plugin - The plugin
      Returns:
      the list of resource ids
    • findByListId

      public List<DatabaseResource> findByListId(List<Integer> listId, DatabaseResourceSort resourceSort, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Get the list of database resources from an id list
      Specified by:
      findByListId in interface IDatabaseResourceDAO
      Parameters:
      listId - The list of ids of resources to get
      resourceSort - The sort parameters
      plugin - The plugin
      Returns:
      The list of resources
    • findByResourceType

      public List<DatabaseResource> findByResourceType(String strResourceType, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Get the list of resources that have a given resource type
      Specified by:
      findByResourceType in interface IDatabaseResourceDAO
      Parameters:
      strResourceType - The resource type
      plugin - The plugin
      Returns:
      The list of resources, or an empty list if no resource has the given resource type