|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.subshell.persistence.hibernate.HibernateTransaction
public class HibernateTransaction
Transaction implementation using Hibernate.
Method Summary | ||
---|---|---|
void |
commit()
Commits this Transaction. |
|
|
create(T o)
Creates an object in the database. |
|
|
delete(T o)
Deletes a persistent object from the database. |
|
org.hibernate.Session |
getSession()
Returns this HibernateTransaction's internal Session . |
|
boolean |
isCommitted()
Returns whether this Transaction has been committed/rolled back. |
|
|
isPersistent(T o)
Returns whether an object is persistent. |
|
|
load(Class<T> clazz,
Serializable id)
Loads an object from the database. |
|
void |
rollback()
Rolls back this Transaction. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public <T> T load(Class<T> clazz, Serializable id) throws PersistenceException
Transaction
load
in interface Transaction
clazz
- the object's classid
- the object's ID
PersistenceException
- when loading the object failspublic <T> Serializable create(T o) throws PersistenceException
Transaction
create
in interface Transaction
o
- the object to create
PersistenceException
- when creating the object failspublic <T> void delete(T o) throws PersistenceException
Transaction
delete
in interface Transaction
o
- the object to delete
PersistenceException
- when deleting the object failspublic <T> boolean isPersistent(T o) throws PersistenceException
Transaction
isPersistent
in interface Transaction
PersistenceException
- when there is a persistence-related errorpublic void commit() throws PersistenceException
Transaction
commit
in interface Transaction
PersistenceException
- when committing this Transaction failspublic void rollback() throws PersistenceException
Transaction
rollback
in interface Transaction
PersistenceException
- when rolling back this Transaction failspublic boolean isCommitted()
Transaction
isCommitted
in interface Transaction
public org.hibernate.Session getSession() throws org.hibernate.HibernateException, PersistenceException
Session
.
This method should be used by persistence mappers only.
org.hibernate.HibernateException
PersistenceException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |