Class UnitDAO
java.lang.Object
fr.paris.lutece.plugins.unittree.business.unit.UnitDAO
- All Implemented Interfaces:
IUnitDAO
UnitDAO
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddUserToUnit(int nIdUnit, int nIdUser, fr.paris.lutece.portal.service.plugin.Plugin plugin) Add an user to an unitfindByCode(String strCode, fr.paris.lutece.portal.service.plugin.Plugin plugin) Load the unit by codegetAllSubUnitsId(int nIdUnit, fr.paris.lutece.portal.service.plugin.Plugin plugin) Retrieve Set of all children units idgetSubUnits(int nIdUnit, fr.paris.lutece.portal.service.plugin.Plugin plugin) Retrieve list of direct children unitsgetUnitWithNoChildren(fr.paris.lutece.portal.service.plugin.Plugin plugin) Return all the Unit with no children (level 0)booleanhasSubUnits(int nIdUnit, fr.paris.lutece.portal.service.plugin.Plugin plugin) Check if the given id unit has sub units or notintInsert a new unitbooleanisUserInUnit(int nIdUser, int nIdUnit, fr.paris.lutece.portal.service.plugin.Plugin plugin) Check if the user is in the unitload(int nIdUnit, fr.paris.lutece.portal.service.plugin.Plugin plugin) Load the unitvoidremove(int nIdUnit, fr.paris.lutece.portal.service.plugin.Plugin plugin) Remove a unitvoidremoveUserFromUnit(int nIdUser, int nIdUnit, fr.paris.lutece.portal.service.plugin.Plugin plugin) Remove a given user from the unitvoidremoveUsersFromUnit(int nIdUnit, fr.paris.lutece.portal.service.plugin.Plugin plugin) Remove users from a given id unitselectAll(fr.paris.lutece.portal.service.plugin.Plugin plugin) Select all unitsselectAllIdsUser(fr.paris.lutece.portal.service.plugin.Plugin plugin) Select all ids userselectByFilter(UnitFilter cmFilter, fr.paris.lutece.portal.service.plugin.Plugin plugin) Select the units by filterselectByIdUser(int nIdUser, fr.paris.lutece.portal.service.plugin.Plugin plugin) Load an unit by id userselectIdsUser(int nIdUnit, fr.paris.lutece.portal.service.plugin.Plugin plugin) Select the ids user from a given id unitvoidUpdate a unitvoidupdateParent(int nIdUnitToMove, int nIdNewParent, fr.paris.lutece.portal.service.plugin.Plugin plugin) Update the parent of a unit
-
Constructor Details
-
UnitDAO
public UnitDAO()
-
-
Method Details
-
insert
Insert a new unit -
load
Load the unit -
selectByIdUser
Load an unit by id user- Specified by:
selectByIdUserin interfaceIUnitDAO- Parameters:
nIdUser- the id userplugin- the plugin- Returns:
- a list of
Unit
-
selectAll
Select all units -
remove
public void remove(int nIdUnit, fr.paris.lutece.portal.service.plugin.Plugin plugin) Remove a unit -
hasSubUnits
public boolean hasSubUnits(int nIdUnit, fr.paris.lutece.portal.service.plugin.Plugin plugin) Check if the given id unit has sub units or not- Specified by:
hasSubUnitsin interfaceIUnitDAO- Parameters:
nIdUnit- the id unitplugin- the plugin- Returns:
- true if the unit has sub units, false otherwise
-
getSubUnits
Retrieve list of direct children units- Specified by:
getSubUnitsin interfaceIUnitDAO- Parameters:
nIdUnit- the id unitplugin- the plugin- Returns:
- List of children units
-
getAllSubUnitsId
public Set<Integer> getAllSubUnitsId(int nIdUnit, fr.paris.lutece.portal.service.plugin.Plugin plugin) Retrieve Set of all children units id- Specified by:
getAllSubUnitsIdin interfaceIUnitDAO- Parameters:
nIdUnit- the id unitplugin- the plugin- Returns:
- Set of all children unit id
-
removeUserFromUnit
public void removeUserFromUnit(int nIdUser, int nIdUnit, fr.paris.lutece.portal.service.plugin.Plugin plugin) Remove a given user from the unit- Specified by:
removeUserFromUnitin interfaceIUnitDAO- Parameters:
nIdUser- the id usernIdUnit- The id of the unitplugin- the plugin
-
removeUsersFromUnit
public void removeUsersFromUnit(int nIdUnit, fr.paris.lutece.portal.service.plugin.Plugin plugin) Remove users from a given id unit- Specified by:
removeUsersFromUnitin interfaceIUnitDAO- Parameters:
nIdUnit- the id unitplugin- the plugin
-
update
Update a unit -
selectByFilter
public List<Unit> selectByFilter(UnitFilter cmFilter, fr.paris.lutece.portal.service.plugin.Plugin plugin) Select the units by filter- Specified by:
selectByFilterin interfaceIUnitDAO- Parameters:
cmFilter- the filterplugin- the plugin- Returns:
- a list of
Unit
-
selectAllIdsUser
Select all ids user- Specified by:
selectAllIdsUserin interfaceIUnitDAO- Parameters:
plugin- the plugin- Returns:
- a list of ids user
-
selectIdsUser
public List<Integer> selectIdsUser(int nIdUnit, fr.paris.lutece.portal.service.plugin.Plugin plugin) Select the ids user from a given id unit- Specified by:
selectIdsUserin interfaceIUnitDAO- Parameters:
nIdUnit- the id unitplugin- the plugin- Returns:
- a list of ids user
-
addUserToUnit
public void addUserToUnit(int nIdUnit, int nIdUser, fr.paris.lutece.portal.service.plugin.Plugin plugin) Add an user to an unit- Specified by:
addUserToUnitin interfaceIUnitDAO- Parameters:
nIdUnit- the id unitnIdUser- the id userplugin- the plugin
-
isUserInUnit
public boolean isUserInUnit(int nIdUser, int nIdUnit, fr.paris.lutece.portal.service.plugin.Plugin plugin) Check if the user is in the unit- Specified by:
isUserInUnitin interfaceIUnitDAO- Parameters:
nIdUser- the id usernIdUnit- The id of the unitplugin- the plugin- Returns:
- true if the user is in the unit, false otherwise
-
getUnitWithNoChildren
Return all the Unit with no children (level 0)- Specified by:
getUnitWithNoChildrenin interfaceIUnitDAO- Parameters:
plugin- the plugin- Returns:
- all the Unit with no children (level 0)
-
updateParent
public void updateParent(int nIdUnitToMove, int nIdNewParent, fr.paris.lutece.portal.service.plugin.Plugin plugin) Update the parent of a unit- Specified by:
updateParentin interfaceIUnitDAO- Parameters:
nIdUnitToMove- The id of the unit to change the parent of.nIdNewParent- The id of the new parent of the unit.plugin- The plugin
-
findByCode
Description copied from interface:IUnitDAOLoad the unit by code- Specified by:
findByCodein interfaceIUnitDAO- Parameters:
strCode- the unit codeplugin- the plugin- Returns:
- an instance of
Unit
-