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
.
Message
TRANSFORM_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)
MessageDao
create
in interface MessageDao
MessageDao.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 MessageDao
public 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 MessageDao
public Collection<Message> create(Collection<Message> entities)
MessageDao
entities
collectioncreate
in interface MessageDao
entities
- the collection of Message instances
to create.public void evict(Message entity)
evict
in interface MessageDao
entity
- the entity to evictpublic Collection<Message> find(String key)
MessageDao
Returns a list of all messages for a specific key.
find
in interface MessageDao
MessageDao.find(String)
public Message find(String key, String languageCode)
MessageDao
Returns the message for the key in the specific language or null if there is no one.
find
in interface MessageDao
MessageDao.find(String, String)
public Message find(String key, String languageCode, String fallbackLanguageCode)
MessageDao
Returns the specified message. Returns the message fallback if the original message was not found.
find
in interface MessageDao
MessageDao.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 MessageDao
id
- the identifier of the entity to load.MessageDao.load(int, Long)
public Message load(Long id)
MessageDao
load
in interface MessageDao
MessageDao.load(Long)
public Collection<Message> loadAll()
MessageDao
Message
.loadAll
in interface MessageDao
MessageDao.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 MessageDao
transform
- the flag indicating what transformation to use.MessageDao.loadAll(int)
public void remove(Message message)
MessageDao
remove
in interface MessageDao
MessageDao.remove(com.communote.server.model.i18n.Message)
public void remove(Collection<Message> entities)
MessageDao
entities collection.
remove
in interface MessageDao
public void remove(Long id)
MessageDao
identifier
from the persistent store.remove
in interface MessageDao
MessageDao.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
MessageDao
entities
- 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
MessageDao
entity
- an entity that was foundtransformEntities(int,java.util.Collection)
public void update(Message message)
MessageDao
message
instance in the persistent store.update
in interface MessageDao
MessageDao.update(com.communote.server.model.i18n.Message)
public void update(Collection<Message> entities)
MessageDao
entities
collection in the persistent store.update
in interface MessageDao
Copyright © 2019 Communote team. All rights reserved.