Package com.logicaldoc.core.security.user

# Interface GroupDAO

All Superinterfaces:
  `PersistentObjectDAO<Group>`

All Known Implementing Classes:
  `HibernateGroupDAO`

public interface GroupDAO extends PersistentObjectDAO<Group>

## Field Summary

### Fields inherited from interface com.logicaldoc.core.PersistentObjectDAO

`ENTITY`

## Method Summary

Modifier and Type
Method
Description
`Collection<String>`
`findAllGroupNames(long tenantId)`
This method selects all group names
`Collection<Group>`
`findByLikeName(String name, long tenantId)`
This method finds a Group by name.
`Group`
`findByName(String name, long tenantId)`
Finds a group by name.
`void`
`fixGuestPermissions(Group group)`
`static GroupDAO`
`get()`
Gets the object available in the application context
`void`
`inheritACLs(Group group, long parentGroupId)`
This method replicates all ACLs of the parent group to another group.
`void`
`initialize(Group group)`
Initializes the group collections
`void`
`insert(Group group, long parentGroupId)`
This method persists a new group object.

### Methods inherited from interface com.logicaldoc.core.PersistentObjectDAO

`bulkUpdate, count, count, count, delete, delete, deleteAll, deleteAll, evict, evict, findAll, findAll, findAllIds, findAllIds, findById, findById, findByObjectQuery, findByQuery, findByQuery, findByWhere, findByWhere, findIdsByWhere, findIdsByWhere, getDatabaseMetadata, getDbms, initialize, isMariaDB, isMySQL, isOracle, isPostgreSQL, isSQLServer, jdbcUpdate, jdbcUpdate, query, query, queryForDouble, queryForDouble, queryForInt, queryForInt, queryForList, queryForList, queryForList, queryForLong, queryForLong, queryForObject, queryForObject, queryForResultSet, queryForString, queryForString, store`

## Method Details

### get

static GroupDAO get()
Gets the object available in the application context

Returns:
  the instance of this object in the application context

### insert

void insert(Group group, long parentGroupId) throws PersistenceException
This method persists a new group object. All permissions and extended attributes of the parent group will be replicated.

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

void inheritACLs(Group group, long parentGroupId) throws PersistenceException
This method replicates all ACLs of the parent group to another group.

Attention: The group(groupId) ACLs will be discarded.

Parameters:
  `group` - The group to be altered.
  `parentGroupId` - The group whose ACLs will be inherited.
Throws:
  `PersistenceException` - Error in the database

### findByName

Group findByName(String name, long tenantId) throws PersistenceException
Finds a group by name.

Parameters:
  `name` - name of wanted group.
  `tenantId` - ID of the owning tenant
Returns:
  Wanted group or null.
Throws:
  `PersistenceException` - Error in the database

### findAllGroupNames

Collection<String> findAllGroupNames(long tenantId) throws PersistenceException
This method selects all group names

Parameters:
  `tenantId` - identifier of the tenant
Returns:
  collection of all the group names
Throws:
  `PersistenceException` - Error in the database

### findByLikeName

Collection<Group> findByLikeName(String name, long tenantId) throws PersistenceException
This method finds a Group by name.

Parameters:
  `name` - The name of wanted Group.
  `tenantId` - ID of the owning tenant
Returns:
  Collection of selected groups.
Throws:
  `PersistenceException` - Error in the database

### initialize

void initialize(Group group)
Initializes the group collections

Specified by:
  `initialize` in interface `PersistentObjectDAO<Group>`
Parameters:
  `group` - The entity to be initialised

### fixGuestPermissions

void fixGuestPermissions(Group group) throws PersistenceException

Throws:
  `PersistenceException`