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
.
Group
TRANSFORM_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)
GroupDao
Returns the number of elements within the database.
count
in interface GroupDao
GroupDao.count(String)
public int countMembers(long groupId)
GroupDao
Returns the number of members of the given group.
countMembers
in interface GroupDao
GroupDao.countMembers(long)
public Collection<Group> create(Collection<Group> entities)
GroupDao
entities
collectioncreate
in interface GroupDao
entities
- the collection of Group instances to create.GroupDao.create(Collection <Group>)
public Group create(Group group)
GroupDao
create
in interface GroupDao
GroupDao.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 GroupDao
GroupDao.create(int transform, Group)
public void evict(Group entity)
public Group findByAlias(String alias)
GroupDao
Searches a group by the alias.
findByAlias
in interface GroupDao
GroupDao.findByAlias(String)
protected GlobalIdDao getGlobalIdDao()
globalIdDao
.public Collection<Group> getGroupsOfUser(Long userId)
getGroupsOfUser
in interface GroupDao
GroupDao.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)
GroupDao
Tests whether an entity identified by an ID is member of the group.
isEntityMember
in interface GroupDao
GroupDao.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 GroupDao
id
- the identifier of the entity to load.GroupDao.load(int, Long)
public Group load(Long id)
GroupDao
load
in interface GroupDao
GroupDao.load(Long)
public Collection<Group> loadAll()
GroupDao
Group
.loadAll
in interface GroupDao
GroupDao.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 GroupDao
transform
- the flag indicating what transformation to use.GroupDao.loadAll(int)
public Collection<Group> loadAllWithReferences()
loadAllWithReferences
in interface GroupDao
GroupDao.loadAllWithReferences()
public Collection<Group> loadWithReferences(int offset, int count, String nameFilter)
GroupDao
Loads a range of groups.
loadWithReferences
in interface GroupDao
GroupDao.loadWithReferences(int, int, String)
public void remove(Collection<Group> entities)
GroupDao
entities collection.
remove
in interface GroupDao
GroupDao.remove(Collection <Group>)
public void remove(Group group)
GroupDao
remove
in interface GroupDao
GroupDao.remove(Group)
public void remove(Long id)
GroupDao
identifier
from the persistent
store.remove
in interface GroupDao
GroupDao.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 GroupDao
entities
- 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 GroupDao
entity
- an entity that was foundtransformEntities(int,Collection)
public void update(Collection<Group> entities)
GroupDao
entities
collection in the persistent store.update
in interface GroupDao
GroupDao.update(Collection <Group>)
public void update(Group group)
GroupDao
group
instance in the persistent store.update
in interface GroupDao
GroupDao.update(Group)
Copyright © 2019 Communote team. All rights reserved.