Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.wso2.wsas.util
Class HibernateConfig

    java.lang.Object
      org.wso2.wsas.util.HibernateConfig

    public class HibernateConfig

extends java.lang.Object

A utility for managing Hibernate Configuration related stuff.

We should maintain only one instance of HibernateConfig within WSO2 WSAS admin. Each of the modules/services deployed should also maintain there own single instance

Constructor Summary
`HibernateConfig(java.lang.String dbConnIdentifier, java.lang.String dbDriver, java.lang.String sqlDialect, java.lang.String username, java.lang.String password, java.lang.Class[] dataObjects)` Constructor for initializing this Object providing the DB Connection Identifier (`dbConnIdentifier`), and the the Hibernate Data Object classes (`dataObjects`), along with other DB parameters.
`HibernateConfig(java.lang.String dbConnIdentifier, java.lang.String dbDriver, java.lang.String sqlDialect, java.lang.String username, java.lang.String password, java.lang.String[] hbmXMLFilenames)` Constructor for initializing this Object providing the DB Connection Identifier (`dbConnIdentifier`), and the the Hibernate hbm XML filenames (`hbmXMLFilenames`), along with other DB parameters.

Method Summary
`void` | `closeSession()`
`org.hibernate.Session` | `currentSession()`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### HibernateConfig

    public HibernateConfig(java.lang.String dbConnIdentifier,
                           java.lang.String dbDriver,
                           java.lang.String sqlDialect,
                           java.lang.String username,
                           java.lang.String password,
                           java.lang.Class[] dataObjects)

  Constructor for initializing this Object providing the DB Connection Identifier (`dbConnIdentifier`), and the the Hibernate Data Object classes (`dataObjects`), along with other DB parameters.

  Parameters:
    `dbConnIdentifier` - The database connection identifier. Can be a DB URL or a Datasource JNDI name. If it is a Datsource JNDI name, it should start with java:comp. This is a required parameter
    `dbDriver` - The fully qualified DB driver class name. This is a required parameter
    `sqlDialect` - The hibernate SQL dialect for the specifed RDBMS. This is a required parameter
    `username` - The username to connect to the DB
    `password` - The password corresponding to the `username`
    `dataObjects` - Array of Hibernate Data Object Classes. This is a required parameter

### HibernateConfig

    public HibernateConfig(java.lang.String dbConnIdentifier,
                           java.lang.String dbDriver,
                           java.lang.String sqlDialect,
                           java.lang.String username,
                           java.lang.String password,
                           java.lang.String[] hbmXMLFilenames)

  Constructor for initializing this Object providing the DB Connection Identifier (`dbConnIdentifier`), and the the Hibernate hbm XML filenames (`hbmXMLFilenames`), along with other DB parameters.

  Parameters:
    `dbConnIdentifier` - The database connection identifier. Can be a DB URL or a Datasource JNDI name. If it is a Datsource JNDI name, it should start with java:comp. This is a required parameter
    `dbDriver` - The fully qualified DB driver class name. This is a required parameter
    `sqlDialect` - The hibernate SQL dialect for the specifed RDBMS. This is a required parameter
    `username` - The username to connect to the DB
    `password` - The password corresponding to the `username`
    `hbmXMLFilenames` - Array of Hibernate hbm XML Filenames. This is a required parameter

Method Detail

### currentSession

    public org.hibernate.Session currentSession()
                                         throws org.hibernate.HibernateException

  Throws:
    `org.hibernate.HibernateException`

### closeSession

    public void closeSession()
                      throws org.hibernate.HibernateException

  Throws:
    `org.hibernate.HibernateException`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD