Class HibernateGroupDAO
java.lang.Object
com.logicaldoc.core.HibernatePersistentObjectDAO<Group>
com.logicaldoc.core.security.user.HibernateGroupDAO
- All Implemented Interfaces:
PersistentObjectDAO<Group>
,GroupDAO
Hibernate implementation of
GroupDAO
- Since:
- 3.0
- Author:
- Alessandro Gasparini - LogicalDOC
-
Field Summary
Fields inherited from interface com.logicaldoc.core.PersistentObjectDAO
ENTITY
-
Method Summary
Modifier and TypeMethodDescriptionint
count()
Counts the total number of groupsvoid
delete
(long groupId, int code) This method deletes an entity and you can give a deletion codeboolean
findAllGroupNames
(long tenantId) This method selects all group namesfindByLikeName
(String name, long tenantId) This method finds a Group by name.findByName
(String name, long tenantId) Finds a group by name.void
fixGuestPermissions
(Group group) If the user is guest, we remove not admitted permissionsvoid
inheritACLs
(Group group, long parentGroupId) This method replicates all ACLs of the parent group to another group.void
initialize
(Group group) Doesn't do anything by defaultvoid
This method persists a new group object.void
setMenuDAO
(MenuDAO menuDAO) void
This method persists the entity objectMethods inherited from class com.logicaldoc.core.HibernatePersistentObjectDAO
bulkUpdate, delete, deleteAll, deleteAll, findAll, findAll, findAllIds, findAllIds, findById, findById, findByObjectQuery, findByQuery, findByWhere, findByWhere, findIdsByWhere, findIdsByWhere, getDatabaseMetadata, getDbms, getSessionFactory, isOracle, jdbcUpdate, jdbcUpdate, query, query, queryForDouble, queryForDouble, queryForInt, queryForInt, queryForList, queryForList, queryForList, queryForLong, queryForLong, queryForObject, queryForRowSet, queryForRowSet, queryForString, setSessionFactory
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.logicaldoc.core.PersistentObjectDAO
bulkUpdate, delete, deleteAll, deleteAll, findAll, findAll, findAllIds, findAllIds, findById, findById, findByObjectQuery, findByQuery, findByWhere, findByWhere, findIdsByWhere, findIdsByWhere, getDatabaseMetadata, getDbms, isOracle, jdbcUpdate, jdbcUpdate, query, query, queryForDouble, queryForDouble, queryForInt, queryForInt, queryForList, queryForList, queryForList, queryForLong, queryForLong, queryForObject, queryForRowSet, queryForRowSet, queryForString
-
Method Details
-
getMenuDAO
-
delete
Description copied from interface:PersistentObjectDAO
This method deletes an entity and you can give a deletion code- Specified by:
delete
in interfacePersistentObjectDAO<Group>
- Overrides:
delete
in classHibernatePersistentObjectDAO<Group>
- Parameters:
groupId
- ID of the entity which should be deletedcode
- Deletion code- Throws:
PersistenceException
- raised in case of errors in the database
-
exists
- Throws:
PersistenceException
-
findAllGroupNames
Description copied from interface:GroupDAO
This method selects all group names- Specified by:
findAllGroupNames
in interfaceGroupDAO
- Parameters:
tenantId
- identifier of the tenant- Returns:
- collection of all the group names
- Throws:
PersistenceException
- Error in the database
-
findByName
Description copied from interface:GroupDAO
Finds a group by name.- Specified by:
findByName
in interfaceGroupDAO
- Parameters:
name
- name of wanted group.tenantId
- ID of the owning tenant- Returns:
- Wanted group or null.
- Throws:
PersistenceException
- Error in the database
-
insert
Description copied from interface:GroupDAO
This method persists a new group object. All permissions and extended attributes of the parent group will be replicated.- Specified by:
insert
in interfaceGroupDAO
- Parameters:
group
- Group which should be stored in a database.parentGroupId
- ID of the group this group inherits ACLs from- Throws:
PersistenceException
- Error in the database
-
inheritACLs
Description copied from interface:GroupDAO
This method replicates all ACLs of the parent group to another group.Attention: The group(groupId) ACLs will be discarded.
- Specified by:
inheritACLs
in interfaceGroupDAO
- Parameters:
group
- The group to be altered.parentGroupId
- The group whose ACLs will be inherited.- Throws:
PersistenceException
- Error in the database
-
findByLikeName
Description copied from interface:GroupDAO
This method finds a Group by name.- Specified by:
findByLikeName
in interfaceGroupDAO
- Parameters:
name
- The name of wanted Group.tenantId
- ID of the owning tenant- Returns:
- Collection of selected groups.
- Throws:
PersistenceException
- Error in the database
-
count
Description copied from interface:GroupDAO
Counts the total number of groups- Specified by:
count
in interfaceGroupDAO
- Returns:
- total number of groups
- Throws:
PersistenceException
- Error in the database
-
initialize
Description copied from class:HibernatePersistentObjectDAO
Doesn't do anything by default- Specified by:
initialize
in interfaceGroupDAO
- Specified by:
initialize
in interfacePersistentObjectDAO<Group>
- Overrides:
initialize
in classHibernatePersistentObjectDAO<Group>
- Parameters:
group
- The entity to be initialised
-
store
Description copied from interface:PersistentObjectDAO
This method persists the entity object- Specified by:
store
in interfacePersistentObjectDAO<Group>
- Overrides:
store
in classHibernatePersistentObjectDAO<Group>
- Parameters:
group
- entity to be stored- Throws:
PersistenceException
- raised in case of errors in the database
-
fixGuestPermissions
If the user is guest, we remove not admitted permissions- Specified by:
fixGuestPermissions
in interfaceGroupDAO
- Throws:
PersistenceException
- Error in the DBNumberFormatException
-