Class DatabaseResourceHome

java.lang.Object
fr.paris.lutece.plugins.resource.business.database.DatabaseResourceHome

public final class DatabaseResourceHome extends Object
Database resource home
  • Method Details

    • create

      public static void create(DatabaseResource resource)
      Create a new database resource
      Parameters:
      resource - The resource to creates
    • update

      public static void update(DatabaseResource resource)
      Updates a database resource
      Parameters:
      resource - The resource
    • delete

      public static void delete(int nIdResource)
      Remove a resource from the database
      Parameters:
      nIdResource - the id of the resource
    • findByPrimaryKey

      public static DatabaseResource findByPrimaryKey(int nIdResource)
      Find a resource from its primary key
      Parameters:
      nIdResource - the id of the resource
      Returns:
      The resource, or null if no resource has the given primary key
    • findAll

      public static List<DatabaseResource> findAll()
      Get the list of resources
      Returns:
      The list of resources
    • findAllId

      public static List<Integer> findAllId(DatabaseResourceSort resourceSort)
      Get the list of ids of resources
      Parameters:
      resourceSort - The sort parameters
      Returns:
      The list of ids of resources
    • findByListId

      public static List<DatabaseResource> findByListId(List<Integer> listId, DatabaseResourceSort resourceSort)
      Get the list of database resources from an id list
      Parameters:
      listId - The list of ids of resources to get
      resourceSort - The sort parameters
      Returns:
      The list of resources
    • findByResourceType

      public static List<DatabaseResource> findByResourceType(String strResourceType)
      Get the list of resources that have a given resource type
      Parameters:
      strResourceType - The resource type
      Returns:
      The list of resources, or an empty list if no resource has the given resource type