public class HibernateUtil extends Object implements org.pentaho.platform.api.engine.IPentahoSystemEntryPoint, org.pentaho.platform.api.engine.IPentahoSystemExitPoint
Modifier and Type | Method and Description |
---|---|
static void |
beginTransaction()
Start a new database transaction.
|
static void |
clear() |
static void |
closeSession()
Closes the Session local to the thread.
|
static void |
commitTransaction()
Commit the database transaction.
|
static org.hibernate.Session |
disconnectSession()
Disconnect and return Session from current Thread.
|
static void |
evict(Object obj)
Evicts the object from the Hibernate cache.
|
static void |
flushSession() |
static org.hibernate.cfg.Configuration |
getConfiguration()
Returns the original Hibernate configuration.
|
static org.hibernate.Session |
getSession()
Retrieves the current Session local to the thread.
|
static org.hibernate.SessionFactory |
getSessionFactory()
Returns the SessionFactory used for this static class.
|
static boolean |
isOracleDialect()
HACK This method is necessary to determine whether code should execute based on Oracle in use as the RDBMS
repository for the platform.
|
static void |
makePersistent(Object obj)
Persists changes to the object.
|
static void |
makeTransient(Object obj)
Deletes the object from Hibernate
|
static void |
rebuildSessionFactory()
Rebuild the SessionFactory with the static Configuration.
|
static void |
rebuildSessionFactory(org.hibernate.cfg.Configuration cfg)
Rebuild the SessionFactory with the given Hibernate Configuration.
|
static void |
registerInterceptor(org.hibernate.Interceptor interceptor)
Register a Hibernate interceptor with the current thread.
|
static void |
rollbackTransaction()
Commit the database transaction.
|
static List |
searchForTerm(org.pentaho.platform.api.repository.ISearchable searchable,
String searchTerm,
int searchType)
Searches an ISearchable object for a search term.
|
void |
setUseNewDatasourceService(boolean useNewService) |
void |
systemEntryPoint() |
void |
systemExitPoint() |
public void setUseNewDatasourceService(boolean useNewService)
public static org.hibernate.SessionFactory getSessionFactory()
public static org.hibernate.cfg.Configuration getConfiguration()
public static void rebuildSessionFactory() throws org.pentaho.platform.api.repository.RepositoryException
org.pentaho.platform.api.repository.RepositoryException
public static void rebuildSessionFactory(org.hibernate.cfg.Configuration cfg) throws org.pentaho.platform.api.repository.RepositoryException
cfg
- org.pentaho.platform.api.repository.RepositoryException
public static org.hibernate.Session getSession() throws org.pentaho.platform.api.repository.RepositoryException
org.pentaho.platform.api.repository.RepositoryException
public static void flushSession() throws org.pentaho.platform.api.repository.RepositoryException
org.pentaho.platform.api.repository.RepositoryException
public static void closeSession() throws org.pentaho.platform.api.repository.RepositoryException
org.pentaho.platform.api.repository.RepositoryException
public static void beginTransaction() throws org.pentaho.platform.api.repository.RepositoryException
org.pentaho.platform.api.repository.RepositoryException
public static void commitTransaction() throws org.pentaho.platform.api.repository.RepositoryException
org.pentaho.platform.api.repository.RepositoryException
public static void rollbackTransaction() throws org.pentaho.platform.api.repository.RepositoryException
org.pentaho.platform.api.repository.RepositoryException
public static org.hibernate.Session disconnectSession() throws org.pentaho.platform.api.repository.RepositoryException
org.pentaho.platform.api.repository.RepositoryException
public static void registerInterceptor(org.hibernate.Interceptor interceptor)
Every Session opened is opened with this interceptor after registration. Has no effect if the current Session of the thread is already open, effective on next close()/getSession().
public static List searchForTerm(org.pentaho.platform.api.repository.ISearchable searchable, String searchTerm, int searchType)
searchable
- ISearchable to searchsearchTerm
- Search Term - see above for rulessearchType
- One of: ISearchable.SEARCH_TYPE_PHRASE,ISearchable.SEARCH_TYPE_WORDS_AND,
ISearchable.SEARCH_TYPE_WORDS_ORpublic static void clear()
public static void makePersistent(Object obj) throws org.pentaho.platform.api.repository.RepositoryException
obj
- The object to make persistentorg.pentaho.platform.api.repository.RepositoryException
public static void makeTransient(Object obj) throws org.pentaho.platform.api.repository.RepositoryException
obj
- The object to make transientorg.pentaho.platform.api.repository.RepositoryException
public static boolean isOracleDialect()
public static void evict(Object obj)
obj
- public void systemEntryPoint()
systemEntryPoint
in interface org.pentaho.platform.api.engine.IPentahoSystemEntryPoint
public void systemExitPoint()
systemExitPoint
in interface org.pentaho.platform.api.engine.IPentahoSystemExitPoint