org.yawlfoundation.yawl.elements.data.external
Class HibernateEngine

java.lang.Object
  extended by org.yawlfoundation.yawl.elements.data.external.HibernateEngine

public class HibernateEngine
extends Object

This singleton class provides basic db support methods via Hibernate.

Author:
Michael Adams Date: 09/07/2009

Field Summary
static int DB_DELETE
           
static int DB_INSERT
           
static int DB_UPDATE
           
 
Method Summary
 void configureSession(Properties props, List<Class> classes)
           
 void configureSession(String dialect, String driver, String url, String username, String password, List<Class> classes)
           
 List execNamedQuery(String namedQuery, String key)
           
 List execQuery(String queryString)
           
 List execSQLQuery(String queryString)
          executes a Query object based on the sql string passed
 int execUpdate(String queryString)
           
static HibernateEngine getInstance()
          returns the current HibernateEngine instance
 void initialise()
          initialises hibernate and the required tables
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DB_UPDATE

public static final int DB_UPDATE
See Also:
Constant Field Values

DB_DELETE

public static final int DB_DELETE
See Also:
Constant Field Values

DB_INSERT

public static final int DB_INSERT
See Also:
Constant Field Values
Method Detail

getInstance

public static HibernateEngine getInstance()
returns the current HibernateEngine instance


initialise

public void initialise()
                throws org.hibernate.HibernateException
initialises hibernate and the required tables

Throws:
org.hibernate.HibernateException

configureSession

public void configureSession(String dialect,
                             String driver,
                             String url,
                             String username,
                             String password,
                             List<Class> classes)
                      throws org.hibernate.HibernateException
Throws:
org.hibernate.HibernateException

configureSession

public void configureSession(Properties props,
                             List<Class> classes)

execSQLQuery

public List execSQLQuery(String queryString)
                  throws org.hibernate.HibernateException
executes a Query object based on the sql string passed

Parameters:
queryString - - the sql query to execute
Returns:
the List of Object[]'s returned, or null if the query has some problem
Throws:
org.hibernate.HibernateException

execQuery

public List execQuery(String queryString)

execNamedQuery

public List execNamedQuery(String namedQuery,
                           String key)
                    throws org.hibernate.HibernateException
Throws:
org.hibernate.HibernateException

execUpdate

public int execUpdate(String queryString)
               throws org.hibernate.HibernateException
Throws:
org.hibernate.HibernateException


Copyright © 2004-2012 The YAWL Foundation.