org.jbpm
Class JbpmQuery

java.lang.Object
  extended byorg.jbpm.JbpmQuery
All Implemented Interfaces:
java.io.Serializable

public class JbpmQuery
extends java.lang.Object
implements java.io.Serializable

allows to run arbitrary hibernate queries on the jbpm database.

Hibernate is the most powerfull object relational mapper. jBpm uses this inside. Most of the queries are hidden behind methods in the services. Since we cannot forsee every possible query that users want, we need to have a mechanism that opens the hibernate query capabilities to the user. Of course, its a bit more complex to write your own queries but you'll get all the flexibility in return.

What you need to know to start writing your own custom queries :

If you need an even more flexible querying mechanism, you can use the hibernate session directly :
   ExecutionServiceImpl executionService = (ExecutionServiceImpl) JbpmServiceFactory.getInstance().openExecutionService(actorId);
   HibernateSession hibernateSession = (HibernateSession) executionService.getPersistenceSession();
   net.sf.hibernate.Session session = hibernateSession.getHibernateSession();
 

See Also:
Serialized Form

Field Summary
static org.jbpm.impl.QueryParameterType LONG
           
static org.jbpm.impl.QueryParameterType STRING
           
 
Constructor Summary
JbpmQuery(java.lang.String queryText)
           
 
Method Summary
 void addParameter(java.lang.String name, java.lang.Object value)
           
 void addParameter(java.lang.String name, java.lang.Object value, org.jbpm.impl.QueryParameterType type)
           
 java.util.List getQueryParameters()
           
 java.lang.String getQueryText()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STRING

public static final org.jbpm.impl.QueryParameterType STRING

LONG

public static final org.jbpm.impl.QueryParameterType LONG
Constructor Detail

JbpmQuery

public JbpmQuery(java.lang.String queryText)
Method Detail

addParameter

public void addParameter(java.lang.String name,
                         java.lang.Object value,
                         org.jbpm.impl.QueryParameterType type)

addParameter

public void addParameter(java.lang.String name,
                         java.lang.Object value)

getQueryParameters

public java.util.List getQueryParameters()

getQueryText

public java.lang.String getQueryText()


Version : jbpm-2.0