| java.lang.Object org.apache.roller.business.hibernate.HibernatePersistenceStrategy
HibernatePersistenceStrategy | public class HibernatePersistenceStrategy (Code) | | Base class for Hibernate persistence implementation.
This class serves as a helper/util class for all of the Hibernate
manager implementations by providing a set of basic persistence methods
that can be easily reused.
|
serialVersionUID | final static long serialVersionUID(Code) | | |
sessionFactory | protected static SessionFactory sessionFactory(Code) | | |
HibernatePersistenceStrategy | public HibernatePersistenceStrategy()(Code) | | |
HibernatePersistenceStrategy | public HibernatePersistenceStrategy(String configResource, String dialect) throws Exception(Code) | | Construct self using Hibernate config resource and optional dialect.
Parameters: configResouce - Classpath-based path to Hibernate config file (e.g. "/hibernate.cgf.xml") |
HibernatePersistenceStrategy | public HibernatePersistenceStrategy(String configResource, String dialect, String driverClass, String connectionURL, String username, String password) throws Exception(Code) | | Construct self using Hibernate config resource and optional dialect.
Parameters: configResouce - Classpath-based path to Hibernate config file (e.g. "/hibernate.cgf.xml") |
getSession | public Session getSession()(Code) | | Get persistence session on current thread.
This will open a new Session if one is not already open, otherwise
it will return the already open Session.
|
release | public void release()(Code) | | Release database session, rollback any uncommitted changes.
IMPORTANT: we don't want to open a transaction and force the use of a
jdbc connection just to close the session and do a rollback, so this
method must be sensitive about how the release is triggered.
In particular we don't want to use our custom getSession() method which
automatically begins a transaction. Instead we get a Session and check
if there is already an active transaction that needs to be rolled back.
If not then we can close the Session without ever getting a jdbc
connection, which is important for scalability.
|
remove | public void remove(String id, Class clazz) throws HibernateException(Code) | | Remove object.
TODO BACKEND: force the use of remove(Object) moving forward.
|
remove | public void remove(Assoc assoc) throws HibernateException(Code) | | Remove assoc.
|
store | public void store(Assoc assoc) throws HibernateException(Code) | | Store assoc.
|
|
|