@PermitAll public class JpaTodoDao extends com.whitestein.lsps.common.jpa.AbstractJpaEntityDao<Todo> implements TodoDao
TodoDao.| 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.
|
java.lang.Long |
countLockedTodos(Person person,
TodoListCriteria criteria)
Returns number of todos locked by user
|
java.lang.Long |
countTodos(Person person,
TodoListCriteria criteria,
boolean unlockedOnly)
Returns number of todos visible to user, but not locked by user (if unlockedOnly is true).
|
java.util.Collection<java.lang.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.
|
java.lang.Long |
findTodoIdByTask(long modelInstanceId,
long taskId)
Finds todo id associated with a task.
|
protected java.lang.String |
getColName(java.lang.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. |
java.util.Map<TodoStatus,java.lang.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. |
java.util.List<Todo> |
getTodoListForOrphanedCheck(Person person,
java.util.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,
java.lang.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, setLockModeclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpublic JpaTodoDao()
public JpaTodoDao(javax.persistence.EntityManager em)
em - the entity managerprotected javax.persistence.EntityManager getEntityManager()
getEntityManager in class com.whitestein.lsps.common.jpa.AbstractJpaBasicDao<Todo,java.lang.Long>public void add(Todo todo)
TodoDaopublic void add(TodoEscalation todoEscalation)
TodoDaopublic void remove(TodoRejection rejection)
TodoDaopublic void remove(TodoPerformer performer)
TodoDaopublic QueryResult<Todo> findByCriteria(TodoCriteria criteria)
TodoDaofindByCriteria in interface TodoDaocriteria - criteria for searchingprotected java.lang.String getColName(java.lang.String colName)
getColName in class com.whitestein.lsps.common.jpa.AbstractJpaBasicDao<Todo,java.lang.Long>public Todo getTodo(long todoId)
TodoDaotodoId argument.public Todo getTodoAndLock(long todoId)
TodoDaotodoId argument and
locks it.getTodoAndLock in interface TodoDaotodoId - todo idpublic java.util.Collection<java.lang.String> findAllOnBehalfOf(Todo todo, Person person)
TodoDaofindAllOnBehalfOf in interface TodoDaopublic java.util.Map<TodoStatus,java.lang.Long> getStatusCounts()
TodoDaogetStatusCounts in interface TodoDaopublic void updateTodoAllocatedTo(Todo todo, Person allocatedTo)
TodoDaoallocatedTo
person parameter.updateTodoAllocatedTo in interface TodoDaopublic java.lang.Long countTodos(Person person, TodoListCriteria criteria, boolean unlockedOnly)
TodoDaoTodoDao.getTodoList(Person, TodoListCriteria).total - TodoDao.getPersonalTodoList(Person, PagingCriteria).total.
If unlocked only is false, returns TodoDao.getTodoList(Person, TodoListCriteria).totalcountTodos in interface TodoDaounlockedOnly - if true only unlocked todos will be countedpublic java.lang.Long countLockedTodos(Person person, TodoListCriteria criteria)
TodoDaocountLockedTodos in interface TodoDaopublic long[] getTodoListIds(Person person, TodoListCriteria criteria)
TodoDaoperson's todo list ids, according to given paging criteria.getTodoListIds in interface TodoDaoperson - the person entitycriteria - the paging criteriapublic QueryResult<Todo> getTodoList(Person person, TodoListCriteria criteria)
TodoDaoperson's todo list, according to given paging criteria.getTodoList in interface TodoDaoperson - 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)
TodoDaoperson'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 TodoDaoperson - 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 java.lang.Long findTodoIdByTask(long modelInstanceId,
long taskId)
TodoDaofindTodoIdByTask in interface TodoDaopublic java.util.List<Todo> getTodoListForOrphanedCheck(Person person, java.util.Set<RoleUnitName> removedRoles)
TodoDaogetTodoListForOrphanedCheck in interface TodoDaopublic boolean isUserRejected(long todoId,
java.lang.String personId)
TodoDaoisUserRejected in interface TodoDaoCopyright © 2007-2020 Whitestein Technologies. All Rights Reserved.