Package edu.sc.seis.sod.hibernate
Class AbstractHibernateDB
java.lang.Object
edu.sc.seis.sod.hibernate.AbstractHibernateDB
- Direct Known Subclasses:
EventDB
,NetworkDB
,PlottableDB
,SeismogramFileRefDB
,SodDB
public abstract class AbstractHibernateDB
extends java.lang.Object
-
Field Summary
Fields Modifier and Type Field Description static boolean
DEBUG_SESSION_CREATION
static int
DEBUG_SESSION_CREATION_SECONDS
protected static org.hibernate.SessionFactory
sessionFactory
-
Constructor Summary
Constructors Constructor Description AbstractHibernateDB()
-
Method Summary
Modifier and Type Method Description static void
commit()
commits the current session that is associated with the current thread.protected static org.hibernate.Session
createSession()
static void
flush()
static org.hibernate.StatelessSession
getReadOnlySession()
static org.hibernate.Session
getSession()
protected static org.hibernate.SessionFactory
getSessionFactory()
Deprecated.static java.lang.Object
getTXID()
this should probably only be called for postgres databases.protected static java.util.HashSet<edu.sc.seis.sod.model.common.UnitImpl>
getUnitCache()
protected static edu.sc.seis.sod.model.common.UnitImpl
intern(edu.sc.seis.sod.model.common.UnitImpl unit)
static void
internUnit(edu.sc.seis.sod.model.common.Location loc)
static void
internUnit(edu.sc.seis.sod.model.common.QuantityImpl q)
static boolean
isSessionOpen()
static void
rollback()
rolls back the current session that is associated with the current thread.
-
Field Details
-
DEBUG_SESSION_CREATION
public static boolean DEBUG_SESSION_CREATION -
DEBUG_SESSION_CREATION_SECONDS
public static int DEBUG_SESSION_CREATION_SECONDS -
sessionFactory
protected static org.hibernate.SessionFactory sessionFactory
-
-
Constructor Details
-
AbstractHibernateDB
public AbstractHibernateDB()
-
-
Method Details
-
getTXID
public static java.lang.Object getTXID()this should probably only be called for postgres databases. -
getSessionFactory
@Deprecated protected static org.hibernate.SessionFactory getSessionFactory() throws java.lang.ExceptionDeprecated.- Throws:
java.lang.Exception
-
createSession
protected static org.hibernate.Session createSession() -
getReadOnlySession
public static org.hibernate.StatelessSession getReadOnlySession() -
isSessionOpen
public static boolean isSessionOpen() -
getSession
public static org.hibernate.Session getSession() -
flush
public static void flush() -
commit
public static void commit()commits the current session that is associated with the current thread. -
rollback
public static void rollback()rolls back the current session that is associated with the current thread. -
internUnit
public static void internUnit(edu.sc.seis.sod.model.common.Location loc) -
internUnit
public static void internUnit(edu.sc.seis.sod.model.common.QuantityImpl q) -
intern
protected static edu.sc.seis.sod.model.common.UnitImpl intern(edu.sc.seis.sod.model.common.UnitImpl unit) -
getUnitCache
protected static java.util.HashSet<edu.sc.seis.sod.model.common.UnitImpl> getUnitCache()
-