public interface MessageDao
Message
Modifier and Type | Field and Description |
---|---|
static int |
TRANSFORM_NONE
This constant is used as a transformation flag; entities can be converted automatically into
value objects or other types, different methods in a class implementing this interface
support this feature: look for an
int parameter called transform . |
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<?> |
create(int transform,
Collection<Message> entities)
Does the same thing as
create(com.communote.server.model.i18n.Message) with an
additional flag called transform . |
Object |
create(int transform,
Message message)
Does the same thing as
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.
|
Object |
load(int transform,
Long id)
Does the same thing as
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
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.
|
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. |
static final int TRANSFORM_NONE
int
parameter called transform
.
This specific flag denotes no transformation will occur.Message create(Message message)
Object create(int transform, Message message)
Does the same thing as 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.
Collection<?> create(int transform, Collection<Message> entities)
Does the same thing as 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.
Collection<Message> create(Collection<Message> entities)
entities
collectionentities
- the collection of Message instances
to create.void evict(Message entity)
entity
- the entity to evictCollection<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. Returns the message fallback if the original message was not found.
Object load(int transform, Long id)
Does the same thing as 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.
id
- the identifier of the entity to load.Collection<Message> loadAll()
Message
.Collection<?> loadAll(int transform)
Does the same thing as 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.
transform
- the flag indicating what transformation to use.void remove(Message message)
void remove(Collection<Message> entities)
entities collection.
void remove(Long id)
identifier
from the persistent store.void update(Message message)
message
instance in the persistent store.void update(Collection<Message> entities)
entities
collection in the persistent store.Copyright © 2019 Communote team. All rights reserved.