Constructor and Description |
---|
JpaTodoDao()
Creates new instance.
|
JpaTodoDao(javax.persistence.EntityManager em)
Creates new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
add(Todo todo)
Adds todo to the persistent store.
|
void |
add(TodoEscalation todoEscalation)
Adds todo escalation to the persistent store.
|
Long |
countLockedTodos(Person person,
TodoListCriteria criteria)
Returns number of todos locked by user
|
Long |
countTodos(Person person,
TodoListCriteria criteria,
boolean unlockedOnly)
Returns number of todos visible to user, but not locked by user (if unlockedOnly is true).
|
Collection<String> |
findAllOnBehalfOf(Todo todo,
Person person)
Returns the set ids of users on behalf of which the given person sees
the to-do in his to-do list.
|
QueryResult<Todo> |
findByCriteria(TodoCriteria criteria)
Returns todos which fulfill the given criteria.
|
Long |
findTodoIdByTask(long modelInstanceId,
long taskId)
Finds todo id associated with a task.
|
protected String |
getColName(String colName) |
protected javax.persistence.EntityManager |
getEntityManager() |
QueryResult<Todo> |
getPersonalTodoList(Person person,
PagingCriteria criteria)
Returns
person 's personal todo list (all todos currently locked
by given person ), according to given paging criteria ,
sorted by todo priority and issued date. |
Map<TodoStatus,Long> |
getStatusCounts()
Returns a map of to-do counts grouped by the status.
|
Todo |
getTodo(long todoId)
Returns the todo identified by the given
todoId argument. |
Todo |
getTodoAndLock(long todoId)
Returns the todo identified by the given
todoId argument and
locks it. |
QueryResult<Todo> |
getTodoList(Person person,
TodoListCriteria criteria)
Returns
person 's todo list, according to given paging criteria. |
List<Todo> |
getTodoListForOrphanedCheck(Person person,
Set<RoleUnitName> removedRoles)
Returns list of todos for which a value "isOrphaned" must be recalculated.
|
long[] |
getTodoListIds(Person person,
TodoListCriteria criteria)
Returns
person 's todo list ids, according to given paging criteria. |
boolean |
isUserRejected(long todoId,
String personId)
Returns true if a todo is rejected by a user.
|
void |
remove(TodoPerformer performer)
Removes todo performer.
|
void |
remove(TodoRejection rejection)
Removes todo-rejection from the persistent store.
|
void |
updateTodoAllocatedTo(Todo todo,
Person allocatedTo)
Updates todo's allocated-to field according to given
allocatedTo
person parameter. |
clear, contains, findById, findById, flush, getEntityClass, getEntityName, getReferenceById, merge, persist, refresh, refresh, remove, setEntityClass, setLockMode
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public JpaTodoDao()
public JpaTodoDao(javax.persistence.EntityManager em)
em
- the entity managerprotected javax.persistence.EntityManager getEntityManager()
public void add(Todo todo)
TodoDao
public void add(TodoEscalation todoEscalation)
TodoDao
public void remove(TodoRejection rejection)
TodoDao
public void remove(TodoPerformer performer)
TodoDao
public QueryResult<Todo> findByCriteria(TodoCriteria criteria)
TodoDao
findByCriteria
in interface TodoDao
criteria
- criteria for searchingpublic Todo getTodo(long todoId)
TodoDao
todoId
argument.public Todo getTodoAndLock(long todoId)
TodoDao
todoId
argument and
locks it.getTodoAndLock
in interface TodoDao
todoId
- todo idpublic Collection<String> findAllOnBehalfOf(Todo todo, Person person)
TodoDao
findAllOnBehalfOf
in interface TodoDao
public Map<TodoStatus,Long> getStatusCounts()
TodoDao
getStatusCounts
in interface TodoDao
public void updateTodoAllocatedTo(Todo todo, Person allocatedTo)
TodoDao
allocatedTo
person parameter.updateTodoAllocatedTo
in interface TodoDao
public Long countTodos(Person person, TodoListCriteria criteria, boolean unlockedOnly)
TodoDao
TodoDao.getTodoList(Person, TodoListCriteria)
.total - TodoDao.getPersonalTodoList(Person, PagingCriteria)
.total.
If unlocked only is false, returns TodoDao.getTodoList(Person, TodoListCriteria)
.totalcountTodos
in interface TodoDao
unlockedOnly
- if true only unlocked todos will be countedpublic Long countLockedTodos(Person person, TodoListCriteria criteria)
TodoDao
countLockedTodos
in interface TodoDao
public long[] getTodoListIds(Person person, TodoListCriteria criteria)
TodoDao
person
's todo list ids, according to given paging criteria.getTodoListIds
in interface TodoDao
person
- the person entitycriteria
- the paging criteriapublic QueryResult<Todo> getTodoList(Person person, TodoListCriteria criteria)
TodoDao
person
's todo list, according to given paging criteria.getTodoList
in interface TodoDao
person
- the person entitycriteria
- the paging criteriaQueryResult
containing part of result data corresponding
to the paging criteria and the total count of todos in the result
listpublic QueryResult<Todo> getPersonalTodoList(Person person, PagingCriteria criteria)
TodoDao
person
's personal todo list (all todos currently locked
by given person
), according to given paging criteria
,
sorted by todo priority and issued date.getPersonalTodoList
in interface TodoDao
person
- the person entitycriteria
- the paging criteriaQueryResult
containing part of result data corresponding
to the paging criteria and the total count of todos in the result
listpublic Long findTodoIdByTask(long modelInstanceId, long taskId)
TodoDao
findTodoIdByTask
in interface TodoDao
public List<Todo> getTodoListForOrphanedCheck(Person person, Set<RoleUnitName> removedRoles)
TodoDao
getTodoListForOrphanedCheck
in interface TodoDao
public boolean isUserRejected(long todoId, String personId)
TodoDao
isUserRejected
in interface TodoDao
Copyright © 2007-2020 Whitestein Technologies. All Rights Reserved.