public abstract class TaskDaoBase extends org.springframework.orm.hibernate3.support.HibernateDaoSupport implements TaskDao
Base Spring DAO Class: is able to create, update, remove, load, and find objects of type
com.communote.server.persistence.tasks.Task
.
Task
TRANSFORM_NONE
Constructor and Description |
---|
TaskDaoBase() |
Modifier and Type | Method and Description |
---|---|
Collection<Task> |
create(Collection<Task> entities)
Creates a new instance of com.communote.server.persistence.tasks.Task and adds from the
passed in
entities collection |
Collection<Task> |
create(int transform,
Collection<Task> entities)
Does the same thing as
TaskDao.create(com.communote.server.model.task.Task) with an
additional flag called transform . |
Object |
create(int transform,
Task task)
Does the same thing as
TaskDao.create(com.communote.server.model.task.Task) with an
additional flag called transform . |
Task |
create(Task task)
Creates an instance of com.communote.server.persistence.tasks.Task and adds it to the
persistent store.
|
void |
evict(Task entity)
Evicts (removes) the entity from the hibernate cache
|
Task |
findNextScheduledTask() |
Collection<Task> |
findNextScheduledTasks(Date upperBound,
int maxTasks,
Collection<Long> taskIdsToExclude)
Returns all task, which can be scheduled within the next time frame.
|
Task |
findTaskByUniqueName(String uniqueName) |
protected abstract Task |
handleFindNextScheduledTask()
Performs the core logic for
findNextScheduledTask() |
protected abstract Collection<Task> |
handleFindNextScheduledTasks(Date upperBound,
int maxTasks,
Collection<Long> taskIdsToExclude)
Performs the core logic for
#findNextScheduledTasks(java.util.Date, int,
java.util.Collection |
protected abstract Task |
handleFindTaskByUniqueName(String uniqueName)
Performs the core logic for
findTaskByUniqueName(String) |
Object |
load(int transform,
Long id)
Does the same thing as
TaskDao.load(Long) with an additional flag called
transform . |
Task |
load(Long id)
Loads an instance of com.communote.server.persistence.tasks.Task from the persistent store.
|
Collection<Task> |
loadAll()
Loads all entities of type
Task . |
Collection<?> |
loadAll(int transform)
Does the same thing as
TaskDao.loadAll() with an additional flag called
transform . |
void |
remove(Collection<Task> entities)
Removes all entities in the given
entities |
void |
remove(Long id)
Removes the instance of com.communote.server.persistence.tasks.Task having the given
identifier from the persistent store. |
void |
remove(Task task)
Removes the instance of com.communote.server.persistence.tasks.Task from the persistent
store.
|
protected void |
transformEntities(int transform,
Collection<?> entities)
Transforms a collection of entities using the
transformEntity(int,com.communote.server.model.task.Task) method. |
protected Object |
transformEntity(int transform,
Task 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.tasks.TaskDao , please note that the
TaskDao.TRANSFORM_NONE constant denotes no transformation, so the entity itself will be
returned. |
void |
update(Collection<Task> entities)
Updates all instances in the
entities collection in the persistent store. |
void |
update(Task task)
Updates the
task instance in the persistent store. |
public Task create(Task task)
TaskDao
create
in interface TaskDao
TaskDao.create(com.communote.server.model.task.Task)
public Object create(int transform, Task task)
TaskDao
Does the same thing as TaskDao.create(com.communote.server.model.task.Task)
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<Task> create(int transform, Collection<Task> entities)
TaskDao
Does the same thing as TaskDao.create(com.communote.server.model.task.Task)
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<Task> create(Collection<Task> entities)
TaskDao
entities
collectionpublic void evict(Task entity)
public Task findNextScheduledTask()
TaskDao
findNextScheduledTask
in interface TaskDao
TaskDao.findNextScheduledTask()
public Collection<Task> findNextScheduledTasks(Date upperBound, int maxTasks, Collection<Long> taskIdsToExclude)
TaskDao
Returns all task, which can be scheduled within the next time frame.
findNextScheduledTasks
in interface TaskDao
com.communote.server.persistence.tasks.TaskDao#findNextScheduledTasks(java.util.Date,
int, java.util.Collection)
public Task findTaskByUniqueName(String uniqueName)
TaskDao
findTaskByUniqueName
in interface TaskDao
TaskDao.findTaskByUniqueName(String)
protected abstract Task handleFindNextScheduledTask()
findNextScheduledTask()
protected abstract Collection<Task> handleFindNextScheduledTasks(Date upperBound, int maxTasks, Collection<Long> taskIdsToExclude)
#findNextScheduledTasks(java.util.Date, int,
java.util.Collection)
protected abstract Task handleFindTaskByUniqueName(String uniqueName)
findTaskByUniqueName(String)
public Object load(int transform, Long id)
TaskDao
Does the same thing as TaskDao.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 TaskDao
id
- the identifier of the entity to load.TaskDao.load(int, Long)
public Task load(Long id)
TaskDao
load
in interface TaskDao
TaskDao.load(Long)
public Collection<Task> loadAll()
TaskDao
Task
.loadAll
in interface TaskDao
TaskDao.loadAll()
public Collection<?> loadAll(int transform)
TaskDao
Does the same thing as TaskDao.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 TaskDao
transform
- the flag indicating what transformation to use.TaskDao.loadAll(int)
public void remove(Task task)
TaskDao
remove
in interface TaskDao
TaskDao.remove(com.communote.server.model.task.Task)
public void remove(Collection<Task> entities)
TaskDao
entities collection.
public void remove(Long id)
TaskDao
identifier
from the persistent store.remove
in interface TaskDao
TaskDao.remove(Long)
protected void transformEntities(int transform, Collection<?> entities)
transformEntity(int,com.communote.server.model.task.Task)
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.tasks.TaskDao
entities
- the collection of entities to transformtransformEntity(int,com.communote.server.model.task.Task)
protected Object transformEntity(int transform, Task entity)
transform
flag is set to one of the constants defined in
com.communote.server.persistence.tasks.TaskDao
, please note that the
TaskDao.TRANSFORM_NONE
constant denotes no transformation, so the entity itself will be
returned.
If the integer argument value is unknown TaskDao.TRANSFORM_NONE
is assumed.transform
- one of the constants declared in
TaskDao
entity
- an entity that was foundtransformEntities(int,java.util.Collection)
public void update(Task task)
TaskDao
task
instance in the persistent store.update
in interface TaskDao
TaskDao.update(com.communote.server.model.task.Task)
public void update(Collection<Task> entities)
TaskDao
entities
collection in the persistent store.Copyright © 2019 Communote team. All rights reserved.