Class DatabaseResourceDAO
java.lang.Object
fr.paris.lutece.plugins.resource.business.database.DatabaseResourceDAO
- All Implemented Interfaces:
IDatabaseResourceDAO
@ApplicationScoped
@Named("resource.databaseResourceDAO")
public class DatabaseResourceDAO
extends Object
implements IDatabaseResourceDAO
DAO for database resources
-
Field Summary
Fields inherited from interface fr.paris.lutece.plugins.resource.business.database.IDatabaseResourceDAO
BEAN_NAME -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddelete(int nIdResource, fr.paris.lutece.portal.service.plugin.Plugin plugin) Remove a resource from the databasefindAll(fr.paris.lutece.portal.service.plugin.Plugin plugin) Get the list of resourcesfindAllId(DatabaseResourceSort resourceSort, fr.paris.lutece.portal.service.plugin.Plugin plugin) Get the list of resource idsfindByListId(List<Integer> listId, DatabaseResourceSort resourceSort, fr.paris.lutece.portal.service.plugin.Plugin plugin) Get the list of database resources from an id listfindByPrimaryKey(int nIdResource, fr.paris.lutece.portal.service.plugin.Plugin plugin) Find a resource from its primary keyfindByResourceType(String strResourceType, fr.paris.lutece.portal.service.plugin.Plugin plugin) Get the list of resources that have a given resource typevoidinsert(DatabaseResource resource, fr.paris.lutece.portal.service.plugin.Plugin plugin) insert a new resource into the databasevoidupdate(DatabaseResource resource, fr.paris.lutece.portal.service.plugin.Plugin plugin) Updates a database resource
-
Constructor Details
-
DatabaseResourceDAO
public DatabaseResourceDAO()
-
-
Method Details
-
insert
insert a new resource into the database- Specified by:
insertin interfaceIDatabaseResourceDAO- Parameters:
resource- The resource to createsplugin- The plugin
-
update
Updates a database resource- Specified by:
updatein interfaceIDatabaseResourceDAO- Parameters:
resource- The resourceplugin- The plugin
-
delete
public void delete(int nIdResource, fr.paris.lutece.portal.service.plugin.Plugin plugin) Remove a resource from the database- Specified by:
deletein interfaceIDatabaseResourceDAO- Parameters:
nIdResource- the id of the resourceplugin- 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:
findByPrimaryKeyin interfaceIDatabaseResourceDAO- Parameters:
nIdResource- the id of the resourceplugin- The plugin- Returns:
- The resource, or null if no resource has the given primary key
-
findAll
Get the list of resources- Specified by:
findAllin interfaceIDatabaseResourceDAO- 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:
findAllIdin interfaceIDatabaseResourceDAO- Parameters:
resourceSort- The sort parametersplugin- 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:
findByListIdin interfaceIDatabaseResourceDAO- Parameters:
listId- The list of ids of resources to getresourceSort- The sort parametersplugin- 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:
findByResourceTypein interfaceIDatabaseResourceDAO- Parameters:
strResourceType- The resource typeplugin- The plugin- Returns:
- The list of resources, or an empty list if no resource has the given resource type
-