public abstract class MessageDaoBase extends org.springframework.orm.hibernate3.support.HibernateDaoSupport implements MessageDao
Base Spring DAO Class: is able to create, update, remove, load, and find objects of type
Message.
MessageTRANSFORM_NONE| Constructor and Description |
|---|
MessageDaoBase() |
| Modifier and Type | Method and Description |
|---|---|
Collection<Message> |
create(Collection<Message> entities)
Creates a new instance of Message and adds from
the passed in
entities collection |
Collection<Message> |
create(int transform,
Collection<Message> entities)
Does the same thing as
MessageDao.create(com.communote.server.model.i18n.Message) with an
additional flag called transform. |
Object |
create(int transform,
Message message)
Does the same thing as
MessageDao.create(com.communote.server.model.i18n.Message) with an
additional flag called transform. |
Message |
create(Message message)
Creates an instance of Message and adds it to
the persistent store.
|
void |
evict(Message entity)
Evicts (removes) the entity from the hibernate cache
|
Collection<Message> |
find(String key)
Returns a list of all messages for a specific key.
|
Message |
find(String key,
String languageCode)
Returns the message for the key in the specific language or null if there is no one.
|
Message |
find(String key,
String languageCode,
String fallbackLanguageCode)
Returns the specified message.
|
protected abstract Collection<Message> |
handleFind(String key)
Performs the core logic for
find(String) |
protected abstract Message |
handleFind(String key,
String languageCode)
Performs the core logic for
find(String, String) |
protected abstract Message |
handleFind(String key,
String languageCode,
String fallbackLanguageCode)
Performs the core logic for
find(String, String, String) |
Object |
load(int transform,
Long id)
Does the same thing as
MessageDao.load(Long) with an additional flag called
transform. |
Message |
load(Long id)
Loads an instance of Message from the
persistent store.
|
Collection<Message> |
loadAll()
Loads all entities of type
Message. |
Collection<?> |
loadAll(int transform)
Does the same thing as
MessageDao.loadAll() with an additional flag called
transform. |
void |
remove(Collection<Message> entities)
Removes all entities in the given
entities |
void |
remove(Long id)
Removes the instance of Message having the
given
identifier from the persistent store. |
void |
remove(Message message)
Removes the instance of Message from the
persistent store.
|
protected void |
transformEntities(int transform,
Collection<?> entities)
Transforms a collection of entities using the
transformEntity(int,com.communote.server.model.i18n.Message) method. |
protected Object |
transformEntity(int transform,
Message 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
MessageDao, please note that the
MessageDao.TRANSFORM_NONE constant denotes no transformation, so the entity itself will be
returned. |
void |
update(Collection<Message> entities)
Updates all instances in the
entities collection in the persistent store. |
void |
update(Message message)
Updates the
message instance in the persistent store. |
public Message create(Message message)
MessageDaocreate in interface MessageDaoMessageDao.create(com.communote.server.model.i18n.Message)public Object create(int transform, Message message)
MessageDao
Does the same thing as MessageDao.create(com.communote.server.model.i18n.Message) 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 MessageDaopublic Collection<Message> create(int transform, Collection<Message> entities)
MessageDao
Does the same thing as MessageDao.create(com.communote.server.model.i18n.Message) 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 MessageDaopublic Collection<Message> create(Collection<Message> entities)
MessageDaoentities collectioncreate in interface MessageDaoentities - the collection of Message instances
to create.public void evict(Message entity)
evict in interface MessageDaoentity - the entity to evictpublic Collection<Message> find(String key)
MessageDaoReturns a list of all messages for a specific key.
find in interface MessageDaoMessageDao.find(String)public Message find(String key, String languageCode)
MessageDaoReturns the message for the key in the specific language or null if there is no one.
find in interface MessageDaoMessageDao.find(String, String)public Message find(String key, String languageCode, String fallbackLanguageCode)
MessageDaoReturns the specified message. Returns the message fallback if the original message was not found.
find in interface MessageDaoMessageDao.find(String, String, String)protected abstract Collection<Message> handleFind(String key)
find(String)protected abstract Message handleFind(String key, String languageCode)
find(String, String)protected abstract Message handleFind(String key, String languageCode, String fallbackLanguageCode)
find(String, String, String)public Object load(int transform, Long id)
MessageDao
Does the same thing as MessageDao.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 MessageDaoid - the identifier of the entity to load.MessageDao.load(int, Long)public Message load(Long id)
MessageDaoload in interface MessageDaoMessageDao.load(Long)public Collection<Message> loadAll()
MessageDaoMessage.loadAll in interface MessageDaoMessageDao.loadAll()public Collection<?> loadAll(int transform)
MessageDao
Does the same thing as MessageDao.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 MessageDaotransform - the flag indicating what transformation to use.MessageDao.loadAll(int)public void remove(Message message)
MessageDaoremove in interface MessageDaoMessageDao.remove(com.communote.server.model.i18n.Message)public void remove(Collection<Message> entities)
MessageDaoentities collection.remove in interface MessageDaopublic void remove(Long id)
MessageDaoidentifier from the persistent store.remove in interface MessageDaoMessageDao.remove(Long)protected void transformEntities(int transform,
Collection<?> entities)
transformEntity(int,com.communote.server.model.i18n.Message) method. This method
does not instantiate a new collection.
This method is to be used internally only.transform - one of the constants declared in
MessageDaoentities - the collection of entities to transformtransformEntity(int,com.communote.server.model.i18n.Message)protected Object transformEntity(int transform, Message entity)
transform flag is set to one of the constants defined in
MessageDao, please note that the
MessageDao.TRANSFORM_NONE constant denotes no transformation, so the entity itself will be
returned.
If the integer argument value is unknown MessageDao.TRANSFORM_NONE is assumed.transform - one of the constants declared in
MessageDaoentity - an entity that was foundtransformEntities(int,java.util.Collection)public void update(Message message)
MessageDaomessage instance in the persistent store.update in interface MessageDaoMessageDao.update(com.communote.server.model.i18n.Message)public void update(Collection<Message> entities)
MessageDaoentities collection in the persistent store.update in interface MessageDaoCopyright © 2019 Communote team. All rights reserved.