|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jbpm.task.service.persistence.TaskPersistenceManager
public class TaskPersistenceManager
From the Hibernate docs:
An EntityManager is an inexpensive, non-threadsafe object that should be used once, for a single business process, a single unit of work, and then discarded. An EntityManager will not obtain a JDBC Connection (or a Datasource) unless it is needed, so you may safely open and close an EntityManager even if you are not sure that data access will be needed to serve a particular request.This class is a wrapper around the entity manager that handles all persistence operations. This way, the persistence functionality can be isolated from the human-task server functionality. This class is only mean to be used in one thread: with every request handled by the human-task server, a TaskServiceSession is created with an instance of this class. Once the request has been handled, the TaskServiceSession instance and the TaskPersistenceManager instance are disposed of.
Field Summary | |
---|---|
static String |
FIRST_RESULT
|
static String |
MAX_RESULTS
|
Method Summary | |
---|---|
static HashMap<String,Object> |
addParametersToMap(Object... parameterValues)
|
boolean |
beginTransaction()
|
javax.persistence.Query |
createNewQuery(String queryString)
It is strongly suggested that you only use this method within a transaction!! |
void |
deleteEntity(Object entity)
|
void |
dispose()
|
void |
endPersistenceContext()
|
void |
endTransaction(boolean txOwner)
|
Object |
findEntity(Class<?> entityClass,
Object primaryKey)
|
List<DeadlineSummary> |
getUnescalatedDeadlines()
Special onetime method |
List<DeadlineSummary> |
getUnescalatedDeadlinesList()
|
boolean |
groupExists(String groupId)
|
Object |
queryInTransaction(String queryName)
|
List<TaskSummary> |
queryTasksWithUserIdAndLanguage(String queryName,
String userId,
String language)
|
List<TaskSummary> |
queryTasksWithUserIdStatusAndLanguage(String queryName,
String userId,
List<Status> status,
String language)
|
Object |
queryWithParametersInTransaction(String queryName,
Map<String,Object> params)
|
Object |
queryWithParametersInTransaction(String queryName,
Map<String,Object> params,
boolean singleResult)
This method runs a query within a transaction and returns the result. |
void |
rollBackTransaction(boolean txOwner)
|
void |
saveEntity(Object entity)
|
void |
setTaskStatusInTransaction(Object taskId,
Status taskStatus)
Special onetime method |
boolean |
userExists(String userId)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String FIRST_RESULT
public static final String MAX_RESULTS
Method Detail |
---|
public boolean beginTransaction()
public void endTransaction(boolean txOwner)
public void rollBackTransaction(boolean txOwner)
public void dispose()
public void endPersistenceContext()
public List<DeadlineSummary> getUnescalatedDeadlines()
public void setTaskStatusInTransaction(Object taskId, Status taskStatus)
taskId
- taskStatus
- public List<DeadlineSummary> getUnescalatedDeadlinesList()
public Object findEntity(Class<?> entityClass, Object primaryKey)
public void deleteEntity(Object entity)
public void saveEntity(Object entity)
public javax.persistence.Query createNewQuery(String queryString)
queryString
- The JPQL query string to execute.
public boolean userExists(String userId)
public boolean groupExists(String groupId)
public List<TaskSummary> queryTasksWithUserIdAndLanguage(String queryName, String userId, String language)
public List<TaskSummary> queryTasksWithUserIdStatusAndLanguage(String queryName, String userId, List<Status> status, String language)
public Object queryWithParametersInTransaction(String queryName, Map<String,Object> params, boolean singleResult)
TaskServiceSession.doOperationInTransaction(org.jbpm.task.service.TaskServiceSession.TransactedOperation)
.
If you change the logic here, please make sure to change the logic there as well (and vice versa).
queryName
- params
-
public Object queryWithParametersInTransaction(String queryName, Map<String,Object> params)
public Object queryInTransaction(String queryName)
public static HashMap<String,Object> addParametersToMap(Object... parameterValues)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |