public final class UnitHome extends Object
Modifier and Type | Method and Description |
---|---|
static void |
addUserToUnit(int nIdUnit,
int nIdUser)
Add the user to the unit
|
static int |
create(Unit unit)
Insert a new unit
|
static List<Unit> |
findAll()
Select all units
|
static List<Integer> |
findAllIdsUsers()
Find all ids users
|
static List<Unit> |
findByFilter(UnitFilter uFilter)
Find the units by filter
|
static List<Unit> |
findByIdUser(int nIdUser)
Load an unit by id user
|
static Unit |
findByPrimaryKey(int nIdUnit)
Load the unit
|
static List<Unit> |
findBySectorId(int nIdSector)
Find the sector id
|
static List<Integer> |
findIdsUser(int nIdUnit)
Find the ids user
|
static List<Unit> |
getUnitWithNoChildren()
Return all the Unit with no children (level 0)
|
static boolean |
hasSubUnits(int nIdUnit)
Check if the given id unit has sub units
|
static boolean |
isUserInUnit(int nIdUser,
int nIdUnit)
Check if the user is in a given unit
|
static void |
remove(int nIdUnit)
Remove a unit
|
static void |
removeUserFromUnit(int nIdUser,
int nIdUnit)
Remove a user from a unit
|
static void |
removeUsersFromUnit(int nIdUnit)
Remove an unit from a given id unit
|
static void |
update(Unit unit)
Update a unit
|
static void |
updateParent(int nIdUnitToMove,
int nIdNewParent)
Update the parent of a unit
|
public static Unit findByPrimaryKey(int nIdUnit)
nIdUnit
- the id unitUnit
public static List<Unit> findByIdUser(int nIdUser)
nIdUser
- the id userUnit
public static List<Unit> findByFilter(UnitFilter uFilter)
uFilter
- the filterUnit
public static List<Integer> findAllIdsUsers()
public static List<Integer> findIdsUser(int nIdUnit)
nIdUnit
- the id unitpublic static int create(Unit unit)
unit
- the unitpublic static void remove(int nIdUnit)
nIdUnit
- the id unitpublic static boolean hasSubUnits(int nIdUnit)
nIdUnit
- the id unitpublic static void removeUserFromUnit(int nIdUser, int nIdUnit)
nIdUser
- the id usernIdUnit
- The id of the unitpublic static void removeUsersFromUnit(int nIdUnit)
nIdUnit
- the id unitpublic static void update(Unit unit)
unit
- the unitpublic static void addUserToUnit(int nIdUnit, int nIdUser)
nIdUnit
- the id unitnIdUser
- the id userpublic static boolean isUserInUnit(int nIdUser, int nIdUnit)
nIdUser
- the id usernIdUnit
- The id of the unitpublic static List<Unit> getUnitWithNoChildren()
public static List<Unit> findBySectorId(int nIdSector)
nIdSector
- the id sectorUnit
public static void updateParent(int nIdUnitToMove, int nIdNewParent)
nIdUnitToMove
- The id of the unit to change the parent of.nIdNewParent
- The id of the new parent of the unit.Copyright © 2017 City of Paris. All rights reserved.