|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.crowd.util.persistence.hibernate.HibernateDao com.atlassian.crowd.dao.group.GroupDAOHibernate
public class GroupDAOHibernate
Field Summary |
---|
Fields inherited from class com.atlassian.crowd.util.persistence.hibernate.HibernateDao |
---|
batchFinder, batchProcessor, logger, sessionFactory |
Constructor Summary | |
---|---|
GroupDAOHibernate()
|
Method Summary | ||
---|---|---|
InternalGroup |
add(Group group)
Adds a new group. |
|
BatchResultWithIdReferences<Group> |
addAll(Collection<InternalGroupWithAttributes> groups)
Bulk add of groups and their attributes. |
|
BatchResult<Group> |
addAll(Set<? extends Group> groups)
Bulk add of groups. |
|
InternalGroup |
addLocal(Group group)
Add a new local group. |
|
InternalGroup |
findByName(long directoryId,
String groupName)
Finds internal group by directory id and group name. |
|
Collection<InternalGroup> |
findByNames(long directoryID,
Collection<String> groupnames)
Bulk find of groups using SQL disjunction. |
|
InternalGroupWithAttributes |
findByNameWithAttributes(long directoryId,
String groupName)
Finds group by name. |
|
Set<InternalGroupAttribute> |
findGroupAttributes(long groupId)
Finds group attributes of the given group identified by group id. |
|
Class |
getPersistentClass()
All subclasses of HibernateDao must implement this method for HibernateDao.load(long) to work correctly. |
|
void |
remove(Group group)
Removes group. |
|
void |
removeAll(long directoryId)
Removes all groups from a directory. |
|
BatchResult<String> |
removeAllGroups(long directoryId,
Set<String> groupNames)
Bulk remove all the given groups. |
|
void |
removeAttribute(Group group,
String attributeName)
Remove the attribute from the group. |
|
InternalGroup |
rename(Group group,
String newName)
Renames group. |
|
|
search(long directoryId,
EntityQuery<T> query)
Searches for group based on the given criteria. |
|
void |
setAttributesHelper(InternalAttributesHelper attributesHelper)
|
|
void |
setDirectoryDao(DirectoryDao directoryDao)
|
|
void |
setHqlQueryTranslater(HQLQueryTranslater hqlQueryTranslater)
|
|
void |
setMembershipDao(InternalMembershipDao membershipDao)
|
|
void |
storeAttributes(Group group,
Map<String,Set<String>> attributes)
Stores attributes into group. |
|
InternalGroup |
update(Group group)
Updates group. |
Methods inherited from class com.atlassian.crowd.util.persistence.hibernate.HibernateDao |
---|
createHibernateQuery, load, load, loadReference, loadReference, remove, save, saveOrUpdate, session, setBatchFinder, setBatchProcessor, setSessionFactory, update |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GroupDAOHibernate()
Method Detail |
---|
public InternalGroup add(Group group) throws DirectoryNotFoundException, InvalidGroupException
GroupDao
add
in interface GroupDao
group
- group
DirectoryNotFoundException
- if the directory specified in group object does not exist
InvalidGroupException
- if a group with the same directory and name (case-insensitive) already existspublic BatchResult<Group> addAll(Set<? extends Group> groups) throws DirectoryNotFoundException
GroupDao
addAll
in interface GroupDao
groups
- to be added
DirectoryNotFoundException
- if the directory cannot be foundpublic BatchResultWithIdReferences<Group> addAll(Collection<InternalGroupWithAttributes> groups)
InternalGroupDao
addAll
in interface InternalGroupDao
groups
- Groups with attributes.
public InternalGroup addLocal(Group group) throws DirectoryNotFoundException, InvalidGroupException
GroupDao
addLocal
in interface GroupDao
group
- group
DirectoryNotFoundException
- if the directory specified in group object does not exist
InvalidGroupException
- if a group with the same directory and name (case-insensitive) already existspublic InternalGroup findByName(long directoryId, String groupName) throws GroupNotFoundException
InternalGroupDao
findByName
in interface InternalGroupDao
findByName
in interface GroupDao
directoryId
- Directory id.groupName
- Group name.
GroupNotFoundException
- If the group cannot be found.public InternalGroupWithAttributes findByNameWithAttributes(long directoryId, String groupName) throws GroupNotFoundException
GroupDao
GroupDao.findByName(long, String)
in that it also returns
the group attributes associated with the retrieved group.
findByNameWithAttributes
in interface GroupDao
directoryId
- the ID of the directory to look for groupgroupName
- group name
GroupNotFoundException
- if the group does not existpublic Collection<InternalGroup> findByNames(long directoryID, Collection<String> groupnames)
InternalGroupDao
findByNames
in interface InternalGroupDao
directoryID
- the directory to search for the groups.groupnames
- names of groups to find
public Set<InternalGroupAttribute> findGroupAttributes(long groupId)
InternalGroupDao
findGroupAttributes
in interface InternalGroupDao
groupId
- Group id.
public Class getPersistentClass()
HibernateDao
HibernateDao.load(long)
to work correctly.
getPersistentClass
in class HibernateDao
public void remove(Group group) throws GroupNotFoundException
GroupDao
remove
in interface GroupDao
group
- group
GroupNotFoundException
- if the group does not existpublic void removeAll(long directoryId)
InternalGroupDao
removeAll
in interface InternalGroupDao
directoryId
- Directory Id.public BatchResult<String> removeAllGroups(long directoryId, Set<String> groupNames)
GroupDao
removeAllGroups
in interface GroupDao
directoryId
- directory to perform the operationgroupNames
- groups to be removed
public void removeAttribute(Group group, String attributeName) throws GroupNotFoundException
GroupDao
removeAttribute
in interface GroupDao
group
- groupattributeName
- attribute to be removed
GroupNotFoundException
- if the group does not existpublic InternalGroup rename(Group group, String newName) throws GroupNotFoundException, InvalidGroupException
GroupDao
rename
in interface GroupDao
group
- groupnewName
- the new name
GroupNotFoundException
- if the group does not exist
InvalidGroupException
- if a group with the same directory and name (case-insensitive) already existspublic <T> List<T> search(long directoryId, EntityQuery<T> query)
GroupDao
search
in interface GroupDao
directoryId
- directory to perform the search operation onquery
- criteria
public void storeAttributes(Group group, Map<String,Set<String>> attributes) throws GroupNotFoundException
GroupDao
storeAttributes
in interface GroupDao
group
- groupattributes
- attributes
GroupNotFoundException
- if the group does not existpublic InternalGroup update(Group group) throws GroupNotFoundException
GroupDao
update
in interface GroupDao
group
- group
GroupNotFoundException
- if the group does not exist@Autowired public void setAttributesHelper(InternalAttributesHelper attributesHelper)
@Autowired public void setDirectoryDao(DirectoryDao directoryDao)
@Autowired public void setHqlQueryTranslater(HQLQueryTranslater hqlQueryTranslater)
@Autowired public void setMembershipDao(InternalMembershipDao membershipDao)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |