Class DatabaseResourceDAO

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void delete​(int nIdResource, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Remove a resource from the database
      java.util.List<DatabaseResource> findAll​(fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Get the list of resources
      java.util.List<java.lang.Integer> findAllId​(DatabaseResourceSort resourceSort, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Get the list of resource ids
      java.util.List<DatabaseResource> findByListId​(java.util.List<java.lang.Integer> listId, DatabaseResourceSort resourceSort, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Get the list of database resources from an id list
      DatabaseResource findByPrimaryKey​(int nIdResource, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Find a resource from its primary key
      java.util.List<DatabaseResource> findByResourceType​(java.lang.String strResourceType, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Get the list of resources that have a given resource type
      void insert​(DatabaseResource resource, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      insert a new resource into the database
      void update​(DatabaseResource resource, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Updates a database resource
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DatabaseResourceDAO

        public DatabaseResourceDAO()
    • Method Detail

      • 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 java.util.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 java.util.List<java.lang.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 java.util.List<DatabaseResource> findByListId​(java.util.List<java.lang.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 java.util.List<DatabaseResource> findByResourceType​(java.lang.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