org.jbpm.task.service.persistence
Class TaskPersistenceManager

java.lang.Object
  extended by org.jbpm.task.service.persistence.TaskPersistenceManager

public class TaskPersistenceManager
extends Object

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.


Method Summary
 boolean beginTransaction()
           
 javax.persistence.Query createNewQuery(String queryString)
           
 javax.persistence.Query createQuery(String queryName)
           
 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)
           
 List<TaskSummary> queryTasksWithUserIdAndLanguage(String queryName, String userId, String language)
           
 List<TaskSummary> queryTasksWithUserIdStatusAndLanguage(String queryName, String userId, List<Status> status, String language)
           
 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
 

Method Detail

beginTransaction

public boolean beginTransaction()

endTransaction

public void endTransaction(boolean txOwner)

rollBackTransaction

public void rollBackTransaction(boolean txOwner)

dispose

public void dispose()

endPersistenceContext

public void endPersistenceContext()

getUnescalatedDeadlines

public List<DeadlineSummary> getUnescalatedDeadlines()
Special onetime method

Returns:

setTaskStatusInTransaction

public void setTaskStatusInTransaction(Object taskId,
                                       Status taskStatus)
Special onetime method

Parameters:
taskId -
taskStatus -

getUnescalatedDeadlinesList

public List<DeadlineSummary> getUnescalatedDeadlinesList()

findEntity

public Object findEntity(Class<?> entityClass,
                         Object primaryKey)

deleteEntity

public void deleteEntity(Object entity)

saveEntity

public void saveEntity(Object entity)

createQuery

public javax.persistence.Query createQuery(String queryName)

createNewQuery

public javax.persistence.Query createNewQuery(String queryString)

userExists

public boolean userExists(String userId)

groupExists

public boolean groupExists(String groupId)

queryTasksWithUserIdAndLanguage

public List<TaskSummary> queryTasksWithUserIdAndLanguage(String queryName,
                                                         String userId,
                                                         String language)

queryTasksWithUserIdStatusAndLanguage

public List<TaskSummary> queryTasksWithUserIdStatusAndLanguage(String queryName,
                                                               String userId,
                                                               List<Status> status,
                                                               String language)


Copyright © 2001-2012 JBoss by Red Hat. All Rights Reserved.