|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object lumis.portal.dao.hibernate.HibernateUtil
public class HibernateUtil
A utility class for using hibernate.
Constructor Summary | |
---|---|
HibernateUtil()
|
Method Summary | |
---|---|
static org.hibernate.type.NullableType |
dataTypeToHibernateType(String dataType)
Returns the hibernate type to be used to read/write to the given lumis field data type. |
static void |
destroy()
|
static EntityManagerFactory |
getEntityManagerFactory()
Returns the default entity manager factory, that access the portal's main database. |
static EntityManagerFactory |
getEntityManagerFactory(String databaseId)
Returns the entity manager factory associated with the given id. |
static org.hibernate.SessionFactory |
getSessionFactory()
Returns the default session factory, that access the portal's main database. |
static org.hibernate.SessionFactory |
getSessionFactory(String databaseId)
Returns the session factory associated with the given id. |
static void |
init()
|
static boolean |
isInitialized()
Indicates if the portal's hibernate infra-structure has been initialized. |
static EntityManagerFactory |
registerEntityManagerFactory(String databaseId,
URL configurationURL)
Registers an EntityManagerFactory , based on an hibernate
configuration. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HibernateUtil()
Method Detail |
---|
public static EntityManagerFactory getEntityManagerFactory()
public static org.hibernate.SessionFactory getSessionFactory()
public static EntityManagerFactory registerEntityManagerFactory(String databaseId, URL configurationURL)
EntityManagerFactory
, based on an hibernate
configuration.
The registered EntityManagerFactory
will be available in
getEntityManagerFactory(String)
using the same databaseId value.
The respective SessionFactory
will also be available in
getSessionFactory(String)
using the same databaseId value.
databaseId
- the database identifier used as a key for the
EntityManagerFactory being registered.configurationURL
- the URL for the hibernate configuration.
public static EntityManagerFactory getEntityManagerFactory(String databaseId)
databaseId
- the id that identifies the database.
public static org.hibernate.SessionFactory getSessionFactory(String databaseId)
databaseId
- the id that identifies the database the session factory
accesses.
public static org.hibernate.type.NullableType dataTypeToHibernateType(String dataType)
dataType
- the lumis field data type.
public static boolean isInitialized()
true
if initialized, false
otherwise.public static void init()
public static void destroy()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |