|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jalios.jcms.db.HibernateManager
public class HibernateManager
This class is a singleton to manage Hibernate access.
Field Summary | |
---|---|
static String |
REVISION
|
Fields inherited from interface com.jalios.util.JaliosConstants |
---|
CRLF, MILLIS_IN_ONE_DAY, MILLIS_IN_ONE_HOUR, MILLIS_IN_ONE_MINUTE, MILLIS_IN_ONE_MONTH, MILLIS_IN_ONE_SECOND, MILLIS_IN_ONE_WEEK, MILLIS_IN_ONE_YEAR |
Method Summary | |
---|---|
void |
addClass(Class<?> persistentClass)
Adds a persistant class to the hibernate configuration. |
void |
addClass(String className)
Adds a persistant class to the hibernate configuration. |
void |
addDBListener(DBListener listener)
Adds a DBListener for all the classes. |
void |
addDBListener(DBListener listener,
Class<?> clazz)
Adds a DBListener for the given class. |
void |
addResource(String resourceName)
Read Hibernate mappings as a application resourceName (i.e. |
org.hibernate.SessionFactory |
buildSessionFactory()
Builds and returns the Hibernate SessionFactory. |
void |
checkConfiguration()
Check if the configuration has been correctly set up with an access to hibernate. |
CollectionMappingInfo |
getCollectionMappingInfo(Class<?> clazz,
String property)
Returns the CollectionMappingInfo for the given collection property of the given class. |
org.hibernate.cfg.Configuration |
getConfiguration()
Returns the Hibernate configuration. |
String |
getConnectionDataSource()
Returns the connection datasource set in the Hibernate configuration. |
String |
getConnectionDriver()
Returns the connection driver set in the Hibernate configuration. |
String |
getConnectionPassword()
Returns the connection user's password set in the Hibernate configuration. |
String |
getConnectionPool()
Returns the class name of the connection pool (if any). |
String |
getConnectionUrl()
Returns the connection URL set in the Hibernate configuration. |
String |
getConnectionUsername()
Returns the connection user set in the Hibernate configuration. |
List<Class<? extends Publication>> |
getDBPublicationClassList()
Returns the list of Publication subclasses managed by Hibernate. |
int |
getDefaultMaxResults()
Returns the default value for max-results paging parameter. |
String |
getDialect()
Returns the dialect set in the Hibernate configuration. |
static HibernateManager |
getInstance()
|
Class<?> |
getPersistentClass(String shortName)
Returns the persistent class with the given short (i.e. |
org.hibernate.SessionFactory |
getSessionFactory()
Returns the Hibernate SessionFactory. |
boolean |
isConnectionPoolEnabled()
|
boolean |
isDataSourceConnection()
Returns true if the connection is established with a DataSource declaration. |
boolean |
isJDBCConnection()
Returns true if the connection is established with a JDBC declaration. |
boolean |
isQueryCacheEnabled()
|
boolean |
isSecondLevelCacheEnabled()
|
void |
removeDBListener(DBListener listener)
Removes a DBListener for all the classes. |
void |
removeDBListener(DBListener listener,
Class<?> clazz)
Removes a DBListener for the given class. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String REVISION
Method Detail |
---|
public static HibernateManager getInstance()
public Class<?> getPersistentClass(String shortName)
shortName
- the class short name (eg WFNote for com.jalios.jcms.WFNote)
public CollectionMappingInfo getCollectionMappingInfo(Class<?> clazz, String property)
clazz
- the persisted classproperty
- the name of the property
public org.hibernate.SessionFactory buildSessionFactory()
public org.hibernate.SessionFactory getSessionFactory()
public org.hibernate.cfg.Configuration getConfiguration()
public void addClass(Class<?> persistentClass)
persistentClass
- the class to be addedpublic void addClass(String className)
className
- the name of the class to be addedpublic void addResource(String resourceName)
resourceName
- The resource namepublic void checkConfiguration() throws Exception
Exception
- if configuration in incorrectpublic String getDialect()
public String getConnectionUrl()
public String getConnectionUsername()
public String getConnectionPassword()
public String getConnectionDriver()
public boolean isJDBCConnection()
public boolean isDataSourceConnection()
public String getConnectionDataSource()
public String getConnectionPool()
public boolean isConnectionPoolEnabled()
public boolean isSecondLevelCacheEnabled()
public boolean isQueryCacheEnabled()
public List<Class<? extends Publication>> getDBPublicationClassList()
public int getDefaultMaxResults()
"hibernate.query.default-max-results
public void addDBListener(DBListener listener)
listener
- the listenerpublic void addDBListener(DBListener listener, Class<?> clazz)
listener
- the listenerclazz
- the classpublic void removeDBListener(DBListener listener)
listener
- the listenerpublic void removeDBListener(DBListener listener, Class<?> clazz)
listener
- the listenerclazz
- the class
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |