public abstract class ClientDaoBase extends org.springframework.orm.hibernate3.support.HibernateDaoSupport implements ClientDao
Base Spring DAO Class: is able to create, update, remove, load, and find objects of type
com.communote.server.persistence.user.client.Client
.
Client
TRANSFORM_NONE
Constructor and Description |
---|
ClientDaoBase() |
Modifier and Type | Method and Description |
---|---|
Client |
changeClientStatus(String clientId,
ClientStatus newStatus,
ClientStatus oldStatus) |
Client |
create(Client client)
Creates an instance of com.communote.server.persistence.user.client.Client and adds it to the
persistent store.
|
Collection<Client> |
create(Collection<Client> entities)
Creates a new instance of com.communote.server.persistence.user.client.Client and adds from
the passed in
entities collection |
Object |
create(int transform,
Client client)
Does the same thing as
ClientDao.create(com.communote.server.model.client.Client) with an
additional flag called transform . |
Collection<Client> |
create(int transform,
Collection<Client> entities)
Does the same thing as
ClientDao.create(com.communote.server.model.client.Client) with an
additional flag called transform . |
void |
evict(Client entity)
Evicts (removes) the entity from the hibernate cache
|
Client |
findByClientId(String clientId)
Find the client by its id
|
Client |
findByClientIdForWriting(String clientId)
Find the client by its id and obtain a write lock
|
protected abstract Client |
handleChangeClientStatus(String clientId,
ClientStatus newStatus,
ClientStatus oldStatus)
|
protected abstract Client |
handleFindByClientId(String clientId)
Performs the core logic for
findByClientId(String) |
protected abstract Client |
handleFindByClientIdForWriting(String clientId)
Performs the core logic for
findByClientIdForWriting(String) |
Object |
load(int transform,
Long id)
Does the same thing as
ClientDao.load(Long) with an additional flag called
transform . |
Client |
load(Long id)
Loads an instance of com.communote.server.persistence.user.client.Client from the persistent
store.
|
Collection<Client> |
loadAll()
Loads all entities of type
Client . |
Collection<?> |
loadAll(int transform)
Does the same thing as
ClientDao.loadAll() with an additional flag called
transform . |
void |
remove(Client client)
Removes the instance of com.communote.server.persistence.user.client.Client from the
persistent store.
|
void |
remove(Collection<Client> entities)
Removes all entities in the given
entities |
void |
remove(Long id)
Removes the instance of com.communote.server.persistence.user.client.Client 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.client.Client) method. |
protected Object |
transformEntity(int transform,
Client 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.user.client.ClientDao , please note that the
ClientDao.TRANSFORM_NONE constant denotes no transformation, so the entity itself will be
returned. |
void |
update(Client client)
Updates the
client instance in the persistent store. |
void |
update(Collection<Client> entities)
Updates all instances in the
entities collection in the persistent store. |
public Client changeClientStatus(String clientId, ClientStatus newStatus, ClientStatus oldStatus)
public Client create(Client client)
ClientDao
create
in interface ClientDao
ClientDao.create(com.communote.server.model.client.Client)
public Object create(int transform, Client client)
ClientDao
Does the same thing as ClientDao.create(com.communote.server.model.client.Client)
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.
public Collection<Client> create(int transform, Collection<Client> entities)
ClientDao
Does the same thing as ClientDao.create(com.communote.server.model.client.Client)
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 Collection<Client> create(Collection<Client> entities)
ClientDao
entities
collectionpublic void evict(Client entity)
public Client findByClientId(String clientId)
ClientDao
Find the client by its id
findByClientId
in interface ClientDao
ClientDao.findByClientId(String)
public Client findByClientIdForWriting(String clientId)
ClientDao
Find the client by its id and obtain a write lock
findByClientIdForWriting
in interface ClientDao
ClientDao.findByClientIdForWriting(String)
protected abstract Client handleChangeClientStatus(String clientId, ClientStatus newStatus, ClientStatus oldStatus)
protected abstract Client handleFindByClientId(String clientId)
findByClientId(String)
protected abstract Client handleFindByClientIdForWriting(String clientId)
findByClientIdForWriting(String)
public Object load(int transform, Long id)
ClientDao
Does the same thing as ClientDao.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 ClientDao
id
- the identifier of the entity to load.ClientDao.load(int, Long)
public Client load(Long id)
ClientDao
load
in interface ClientDao
ClientDao.load(Long)
public Collection<Client> loadAll()
ClientDao
Client
.loadAll
in interface ClientDao
ClientDao.loadAll()
public Collection<?> loadAll(int transform)
ClientDao
Does the same thing as ClientDao.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 ClientDao
transform
- the flag indicating what transformation to use.ClientDao.loadAll(int)
public void remove(Client client)
ClientDao
remove
in interface ClientDao
ClientDao.remove(com.communote.server.model.client.Client)
public void remove(Collection<Client> entities)
ClientDao
entities collection.
public void remove(Long id)
ClientDao
identifier
from the persistent store.remove
in interface ClientDao
ClientDao.remove(Long)
protected void transformEntities(int transform, Collection<?> entities)
transformEntity(int,com.communote.server.model.client.Client)
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.user.client.ClientDao
entities
- the collection of entities to transformtransformEntity(int,com.communote.server.model.client.Client)
protected Object transformEntity(int transform, Client entity)
transform
flag is set to one of the constants defined in
com.communote.server.persistence.user.client.ClientDao
, please note that the
ClientDao.TRANSFORM_NONE
constant denotes no transformation, so the entity itself will be
returned.
If the integer argument value is unknown ClientDao.TRANSFORM_NONE
is assumed.transform
- one of the constants declared in
ClientDao
entity
- an entity that was foundtransformEntities(int,java.util.Collection)
public void update(Client client)
ClientDao
client
instance in the persistent store.update
in interface ClientDao
ClientDao.update(com.communote.server.model.client.Client)
public void update(Collection<Client> entities)
ClientDao
entities
collection in the persistent store.Copyright © 2019 Communote team. All rights reserved.