Class DatabaseResourceHome
java.lang.Object
fr.paris.lutece.plugins.resource.business.database.DatabaseResourceHome
Database resource home
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidcreate(DatabaseResource resource) Create a new database resourcestatic voiddelete(int nIdResource) Remove a resource from the databasestatic List<DatabaseResource>findAll()Get the list of resourcesfindAllId(DatabaseResourceSort resourceSort) Get the list of ids of resourcesstatic List<DatabaseResource>findByListId(List<Integer> listId, DatabaseResourceSort resourceSort) Get the list of database resources from an id liststatic DatabaseResourcefindByPrimaryKey(int nIdResource) Find a resource from its primary keystatic List<DatabaseResource>findByResourceType(String strResourceType) Get the list of resources that have a given resource typestatic voidupdate(DatabaseResource resource) Updates a database resource
-
Method Details
-
create
Create a new database resource- Parameters:
resource- The resource to creates
-
update
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
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
Get the list of resources- Returns:
- The list of resources
-
findAllId
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 getresourceSort- The sort parameters- Returns:
- The list of resources
-
findByResourceType
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
-