public abstract class GroupDaoBase extends org.springframework.orm.hibernate3.support.HibernateDaoSupport implements GroupDao
Base Spring DAO Class: is able to create, update, remove, load, and find objects of type
Group.
GroupTRANSFORM_NONE| Constructor and Description |
|---|
GroupDaoBase() |
| Modifier and Type | Method and Description |
|---|---|
int |
count(String filter)
Returns the number of elements within the database.
|
int |
countMembers(long groupId)
Returns the number of members of the given group.
|
Collection<Group> |
create(Collection<Group> entities)
Creates a new instance of Group and adds from the passed in
entities collection |
Group |
create(Group group)
Creates an instance of Group and adds it to the persistent store.
|
Collection<Group> |
create(int transform,
Collection<Group> entities)
Does the same thing as
GroupDao.create(com.communote.server.model.user.group.Group) with an
additional flag called transform. |
Object |
create(int transform,
Group group)
Does the same thing as
GroupDao.create(com.communote.server.model.user.group.Group) with an
additional flag called transform. |
void |
evict(Group entity)
Evicts (removes) the entity from the hibernate cache
|
Group |
findByAlias(String alias)
Searches a group by the alias.
|
protected GlobalIdDao |
getGlobalIdDao()
Gets the reference to
globalIdDao. |
Collection<Group> |
getGroupsOfUser(Long userId) |
protected abstract int |
handleCount(String filter)
Performs the core logic for
count(String) |
protected abstract int |
handleCountMembers(long groupId)
Performs the core logic for
countMembers(long) |
protected abstract Group |
handleFindByAlias(String alias)
Performs the core logic for
findByAlias(String) |
protected abstract Collection<Group> |
handleGetGroupsOfUser(Long userId)
Performs the core logic for
getGroupsOfUser(Long) |
protected abstract boolean |
handleIsEntityMember(Long groupId,
Long entityId)
Performs the core logic for
isEntityMember(Long, Long) |
protected abstract Collection<Group> |
handleLoadAllWithReferences()
Performs the core logic for
loadAllWithReferences() |
protected abstract Collection<Group> |
handleLoadWithReferences(int offset,
int count,
String nameFilter)
Performs the core logic for
loadWithReferences(int, int, String) |
boolean |
isEntityMember(Long groupId,
Long entityId)
Tests whether an entity identified by an ID is member of the group.
|
Object |
load(int transform,
Long id)
Does the same thing as
GroupDao.load(Long) with an additional flag called
transform. |
Group |
load(Long id)
Loads an instance of Group from the persistent store.
|
Collection<Group> |
loadAll()
Loads all entities of type
Group. |
Collection<?> |
loadAll(int transform)
Does the same thing as
GroupDao.loadAll() with an additional flag called
transform. |
Collection<Group> |
loadAllWithReferences() |
Collection<Group> |
loadWithReferences(int offset,
int count,
String nameFilter)
Loads a range of groups.
|
void |
remove(Collection<Group> entities)
Removes all entities in the given
entities |
void |
remove(Group group)
Removes the instance of Group from the persistent store.
|
void |
remove(Long id)
Removes the instance of Group having the given
identifier from the persistent
store. |
void |
setGlobalIdDao(GlobalIdDao globalIdDao)
Sets the reference to
globalIdDao. |
protected void |
transformEntities(int transform,
Collection<?> entities)
Transforms a collection of entities using the
transformEntity(int,Group) method. |
protected Object |
transformEntity(int transform,
Group entity)
Allows transformation of entities into value objects (or something else for that matter),
when the
transform flag is set to one of the constants defined in
GroupDao, please note that the GroupDao.TRANSFORM_NONE constant denotes no
transformation, so the entity itself will be returned. |
void |
update(Collection<Group> entities)
Updates all instances in the
entities collection in the persistent store. |
void |
update(Group group)
Updates the
group instance in the persistent store. |
public int count(String filter)
GroupDaoReturns the number of elements within the database.
count in interface GroupDaoGroupDao.count(String)public int countMembers(long groupId)
GroupDaoReturns the number of members of the given group.
countMembers in interface GroupDaoGroupDao.countMembers(long)public Collection<Group> create(Collection<Group> entities)
GroupDaoentities collectioncreate in interface GroupDaoentities - the collection of Group instances to create.GroupDao.create(Collection <Group>)public Group create(Group group)
GroupDaocreate in interface GroupDaoGroupDao.create(Group)public Collection<Group> create(int transform, Collection<Group> entities)
GroupDao
Does the same thing as GroupDao.create(com.communote.server.model.user.group.Group) with an
additional flag called transform. If this flag is set to
TRANSFORM_NONE then the returned entity will NOT be
transformed. If this flag is any of the other constants defined here then the result
WILL BE passed through an operation which can optionally transform the
entities (into value objects for example). By default, transformation does not occur.
public Object create(int transform, Group group)
GroupDao
Does the same thing as GroupDao.create(com.communote.server.model.user.group.Group) with an
additional flag called transform. If this flag is set to
TRANSFORM_NONE then the returned entity will NOT be
transformed. If this flag is any of the other constants defined here then the result
WILL BE passed through an operation which can optionally transform the
entity (into a value object for example). By default, transformation does not occur.
create in interface GroupDaoGroupDao.create(int transform, Group)public void evict(Group entity)
public Group findByAlias(String alias)
GroupDaoSearches a group by the alias.
findByAlias in interface GroupDaoGroupDao.findByAlias(String)protected GlobalIdDao getGlobalIdDao()
globalIdDao.public Collection<Group> getGroupsOfUser(Long userId)
getGroupsOfUser in interface GroupDaoGroupDao.getGroupsOfUser(Long)protected abstract int handleCount(String filter)
count(String)protected abstract int handleCountMembers(long groupId)
countMembers(long)protected abstract Group handleFindByAlias(String alias)
findByAlias(String)protected abstract Collection<Group> handleGetGroupsOfUser(Long userId)
getGroupsOfUser(Long)protected abstract boolean handleIsEntityMember(Long groupId, Long entityId)
isEntityMember(Long, Long)protected abstract Collection<Group> handleLoadAllWithReferences()
loadAllWithReferences()protected abstract Collection<Group> handleLoadWithReferences(int offset, int count, String nameFilter)
loadWithReferences(int, int, String)public boolean isEntityMember(Long groupId, Long entityId)
GroupDaoTests whether an entity identified by an ID is member of the group.
isEntityMember in interface GroupDaoGroupDao.isEntityMember(Long, Long)public Object load(int transform, Long id)
GroupDao
Does the same thing as GroupDao.load(Long) with an additional flag called
transform. If this flag is set to TRANSFORM_NONE then the returned
entity will NOT be transformed. If this flag is any of the other constants
defined in this class then the result WILL BE passed through an operation
which can optionally transform the entity (into a value object for example). By default,
transformation does not occur.
load in interface GroupDaoid - the identifier of the entity to load.GroupDao.load(int, Long)public Group load(Long id)
GroupDaoload in interface GroupDaoGroupDao.load(Long)public Collection<Group> loadAll()
GroupDaoGroup.loadAll in interface GroupDaoGroupDao.loadAll()public Collection<?> loadAll(int transform)
GroupDao
Does the same thing as GroupDao.loadAll() with an additional flag called
transform. If this flag is set to TRANSFORM_NONE then the returned
entity will NOT be transformed. If this flag is any of the other constants
defined here then the result WILL BE passed through an operation which can
optionally transform the entity (into a value object for example). By default, transformation
does not occur.
loadAll in interface GroupDaotransform - the flag indicating what transformation to use.GroupDao.loadAll(int)public Collection<Group> loadAllWithReferences()
loadAllWithReferences in interface GroupDaoGroupDao.loadAllWithReferences()public Collection<Group> loadWithReferences(int offset, int count, String nameFilter)
GroupDaoLoads a range of groups.
loadWithReferences in interface GroupDaoGroupDao.loadWithReferences(int, int, String)public void remove(Collection<Group> entities)
GroupDaoentities collection.remove in interface GroupDaoGroupDao.remove(Collection <Group>)public void remove(Group group)
GroupDaoremove in interface GroupDaoGroupDao.remove(Group)public void remove(Long id)
GroupDaoidentifier from the persistent
store.remove in interface GroupDaoGroupDao.remove(Long)public void setGlobalIdDao(GlobalIdDao globalIdDao)
globalIdDao.protected void transformEntities(int transform,
Collection<?> entities)
transformEntity(int,Group) method.
This method does not instantiate a new collection.
This method is to be used internally only.transform - one of the constants declared in GroupDaoentities - the collection of entities to transformtransformEntity(int,Group)protected Object transformEntity(int transform, Group entity)
transform flag is set to one of the constants defined in
GroupDao, please note that the GroupDao.TRANSFORM_NONE constant denotes no
transformation, so the entity itself will be returned.
If the integer argument value is unknown GroupDao.TRANSFORM_NONE is assumed.transform - one of the constants declared in GroupDaoentity - an entity that was foundtransformEntities(int,Collection)public void update(Collection<Group> entities)
GroupDaoentities collection in the persistent store.update in interface GroupDaoGroupDao.update(Collection <Group>)public void update(Group group)
GroupDaogroup instance in the persistent store.update in interface GroupDaoGroupDao.update(Group)Copyright © 2019 Communote team. All rights reserved.