public abstract class GlobalIdDaoBase extends org.springframework.orm.hibernate3.support.HibernateDaoSupport implements GlobalIdDao
Base Spring DAO Class: is able to create, update, remove, load, and find objects of type
com.communote.server.persistence.global.GlobalId
.
GlobalId
TRANSFORM_NONE
Constructor and Description |
---|
GlobalIdDaoBase() |
Modifier and Type | Method and Description |
---|---|
Collection<GlobalId> |
create(Collection<GlobalId> entities)
Creates a new instance of com.communote.server.persistence.global.GlobalId and adds from the
passed in
entities collection |
GlobalId |
create(GlobalId globalId)
Creates an instance of com.communote.server.persistence.global.GlobalId and adds it to the
persistent store.
|
Collection<GlobalId> |
create(int transform,
Collection<GlobalId> entities)
Does the same thing as
GlobalIdDao.create(com.communote.server.model.global.GlobalId) with an
additional flag called transform . |
Object |
create(int transform,
GlobalId globalId)
Does the same thing as
GlobalIdDao.create(com.communote.server.model.global.GlobalId) with an
additional flag called transform . |
GlobalId |
createGlobalId(Attachment attachment) |
GlobalId |
createGlobalId(Blog blog) |
GlobalId |
createGlobalId(Group group) |
GlobalId |
createGlobalId(Note note) |
GlobalId |
createGlobalId(Tag tag) |
GlobalId |
createGlobalId(User user) |
void |
evict(GlobalId entity)
Evicts (removes) the entity from the hibernate cache
|
GlobalId |
findByGlobalIdentifier(String globalIdentifier)
Returns a global ID matching the global identifier or null if there is no matching global ID.
|
GlobalId |
findLatestGlobalId()
Returns the latest GlobalID, which is the GlobalID with highest ID member.
|
protected abstract GlobalId |
handleCreateGlobalId(Attachment attachment)
Performs the core logic for
createGlobalId(com.communote.server.model.attachment.Attachment) |
protected abstract GlobalId |
handleCreateGlobalId(Blog blog)
Performs the core logic for
createGlobalId(com.communote.server.model.blog.Blog) |
protected abstract GlobalId |
handleCreateGlobalId(Group group)
Performs the core logic for
createGlobalId(com.communote.server.model.user.group.Group) |
protected abstract GlobalId |
handleCreateGlobalId(Note note)
Performs the core logic for
createGlobalId(com.communote.server.model.note.Note) |
protected abstract GlobalId |
handleCreateGlobalId(Tag tag)
Performs the core logic for
createGlobalId(com.communote.server.model.tag.Tag) |
protected abstract GlobalId |
handleCreateGlobalId(User user)
Performs the core logic for
createGlobalId(com.communote.server.model.user.User) |
protected abstract GlobalId |
handleFindByGlobalIdentifier(String globalIdentifier)
Performs the core logic for
findByGlobalIdentifier(String) |
protected abstract GlobalId |
handleFindLatestGlobalId()
Performs the core logic for
findLatestGlobalId() |
Object |
load(int transform,
Long id)
Does the same thing as
GlobalIdDao.load(Long) with an additional flag called
transform . |
GlobalId |
load(Long id)
Loads an instance of com.communote.server.persistence.global.GlobalId from the persistent
store.
|
Collection<GlobalId> |
loadAll()
Loads all entities of type
GlobalId . |
Collection<?> |
loadAll(int transform)
Does the same thing as
GlobalIdDao.loadAll() with an additional flag called
transform . |
void |
remove(Collection<GlobalId> entities)
Removes all entities in the given
entities |
void |
remove(GlobalId globalId)
Removes the instance of com.communote.server.persistence.global.GlobalId from the persistent
store.
|
void |
remove(Long id)
Removes the instance of com.communote.server.persistence.global.GlobalId having the given
identifier from the persistent store. |
protected void |
transformEntities(int transform,
Collection<?> entities)
Transforms a collection of entities using the
transformEntity(int,com.communote.server.model.global.GlobalId) method. |
protected Object |
transformEntity(int transform,
GlobalId 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
com.communote.server.persistence.global.GlobalIdDao , please note that the
GlobalIdDao.TRANSFORM_NONE constant denotes no transformation, so the entity itself will be
returned. |
void |
update(Collection<GlobalId> entities)
Updates all instances in the
entities collection in the persistent store. |
void |
update(GlobalId globalId)
Updates the
globalId instance in the persistent store. |
public GlobalId create(GlobalId globalId)
GlobalIdDao
create
in interface GlobalIdDao
GlobalIdDao.create(com.communote.server.model.global.GlobalId)
public Object create(int transform, GlobalId globalId)
GlobalIdDao
Does the same thing as GlobalIdDao.create(com.communote.server.model.global.GlobalId)
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 GlobalIdDao
com.communote.server.persistence.global.GlobalIdDao#create(int transform,
com.communote.server.persistence.global.GlobalId)
public Collection<GlobalId> create(int transform, Collection<GlobalId> entities)
GlobalIdDao
Does the same thing as GlobalIdDao.create(com.communote.server.model.global.GlobalId)
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.
create
in interface GlobalIdDao
com.communote.server.persistence.global.GlobalIdDao#create(int,
java.util.Collection)
public Collection<GlobalId> create(Collection<GlobalId> entities)
GlobalIdDao
entities
collectioncreate
in interface GlobalIdDao
entities
- the collection of com.communote.server.persistence.global.GlobalId instances to
create.com.communote.server.persistence.global.GlobalIdDao#create(java.util.Collection)
public GlobalId createGlobalId(Attachment attachment)
createGlobalId
in interface GlobalIdDao
GlobalIdDao.createGlobalId(com.communote.server.model.attachment.Attachment)
public GlobalId createGlobalId(Blog blog)
createGlobalId
in interface GlobalIdDao
GlobalIdDao.createGlobalId(com.communote.server.model.blog.Blog)
public GlobalId createGlobalId(Note note)
createGlobalId
in interface GlobalIdDao
GlobalIdDao.createGlobalId(com.communote.server.model.note.Note)
public GlobalId createGlobalId(Tag tag)
createGlobalId
in interface GlobalIdDao
GlobalIdDao.createGlobalId(com.communote.server.model.tag.Tag)
public GlobalId createGlobalId(Group group)
createGlobalId
in interface GlobalIdDao
GlobalIdDao.createGlobalId(com.communote.server.model.user.group.Group)
public GlobalId createGlobalId(User user)
createGlobalId
in interface GlobalIdDao
GlobalIdDao.createGlobalId(com.communote.server.model.user.User)
public void evict(GlobalId entity)
evict
in interface GlobalIdDao
entity
- the entity to evictpublic GlobalId findByGlobalIdentifier(String globalIdentifier)
GlobalIdDao
Returns a global ID matching the global identifier or null if there is no matching global ID.
findByGlobalIdentifier
in interface GlobalIdDao
GlobalIdDao.findByGlobalIdentifier(String)
public GlobalId findLatestGlobalId()
GlobalIdDao
Returns the latest GlobalID, which is the GlobalID with highest ID member. The return value might be null if there is no global ID yet.
findLatestGlobalId
in interface GlobalIdDao
GlobalIdDao.findLatestGlobalId()
protected abstract GlobalId handleCreateGlobalId(Attachment attachment)
createGlobalId(com.communote.server.model.attachment.Attachment)
protected abstract GlobalId handleCreateGlobalId(Blog blog)
createGlobalId(com.communote.server.model.blog.Blog)
protected abstract GlobalId handleCreateGlobalId(Note note)
createGlobalId(com.communote.server.model.note.Note)
protected abstract GlobalId handleCreateGlobalId(Tag tag)
createGlobalId(com.communote.server.model.tag.Tag)
protected abstract GlobalId handleCreateGlobalId(Group group)
createGlobalId(com.communote.server.model.user.group.Group)
protected abstract GlobalId handleCreateGlobalId(User user)
createGlobalId(com.communote.server.model.user.User)
protected abstract GlobalId handleFindByGlobalIdentifier(String globalIdentifier)
findByGlobalIdentifier(String)
protected abstract GlobalId handleFindLatestGlobalId()
findLatestGlobalId()
public Object load(int transform, Long id)
GlobalIdDao
Does the same thing as GlobalIdDao.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 GlobalIdDao
id
- the identifier of the entity to load.GlobalIdDao.load(int, Long)
public GlobalId load(Long id)
GlobalIdDao
load
in interface GlobalIdDao
GlobalIdDao.load(Long)
public Collection<GlobalId> loadAll()
GlobalIdDao
GlobalId
.loadAll
in interface GlobalIdDao
GlobalIdDao.loadAll()
public Collection<?> loadAll(int transform)
GlobalIdDao
Does the same thing as GlobalIdDao.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 GlobalIdDao
transform
- the flag indicating what transformation to use.GlobalIdDao.loadAll(int)
public void remove(GlobalId globalId)
GlobalIdDao
remove
in interface GlobalIdDao
GlobalIdDao.remove(com.communote.server.model.global.GlobalId)
public void remove(Collection<GlobalId> entities)
GlobalIdDao
entities collection.
remove
in interface GlobalIdDao
com.communote.server.persistence.global.GlobalIdDao#remove(java.util.Collection)
public void remove(Long id)
GlobalIdDao
identifier
from the persistent store.remove
in interface GlobalIdDao
GlobalIdDao.remove(Long)
protected void transformEntities(int transform, Collection<?> entities)
transformEntity(int,com.communote.server.model.global.GlobalId)
method. This method
does not instantiate a new collection.
This method is to be used internally only.transform
- one of the constants declared in
com.communote.server.persistence.global.GlobalIdDao
entities
- the collection of entities to transformtransformEntity(int,com.communote.server.model.global.GlobalId)
protected Object transformEntity(int transform, GlobalId entity)
transform
flag is set to one of the constants defined in
com.communote.server.persistence.global.GlobalIdDao
, please note that the
GlobalIdDao.TRANSFORM_NONE
constant denotes no transformation, so the entity itself will be
returned.
If the integer argument value is unknown GlobalIdDao.TRANSFORM_NONE
is assumed.transform
- one of the constants declared in
GlobalIdDao
entity
- an entity that was foundtransformEntities(int,java.util.Collection)
public void update(GlobalId globalId)
GlobalIdDao
globalId
instance in the persistent store.update
in interface GlobalIdDao
GlobalIdDao.update(com.communote.server.model.global.GlobalId)
public void update(Collection<GlobalId> entities)
GlobalIdDao
entities
collection in the persistent store.update
in interface GlobalIdDao
com.communote.server.persistence.global.GlobalIdDao#update(java.util.Collection)
Copyright © 2019 Communote team. All rights reserved.