public class DBImpl extends java.lang.Object implements DB, Destroyable
限定符和类型 | 方法和说明 |
---|---|
void |
addTransactionListener(ITransactionListener listener)
已过时。
Add an ITransactionListener to this DB instance.
|
void |
cleanUpSession()
已过时。
Close the database session, clean threadlocal but only if necessary
|
void |
closeSession()
已过时。
Close the database session.
|
void |
commit()
已过时。
Call this to commit a transaction opened by beginTransaction().
|
void |
commitAndCloseSession()
已过时。
Checks if the transaction needs to be committed and does so if this is the case, plus closes the connection in any case guaranteed.
|
DBQuery |
createQuery(java.lang.String query)
已过时。
Create a DBQuery
|
int |
delete(java.lang.String query,
java.lang.Object[] values,
org.hibernate.type.Type[] types)
已过时。
Deletion query.
|
int |
delete(java.lang.String query,
java.lang.Object value,
org.hibernate.type.Type type)
已过时。
Deletion query.
|
void |
deleteObject(java.lang.Object object)
已过时。
Delete an object.
|
void |
destroy()
已过时。
|
java.util.List |
find(java.lang.String query)
已过时。
Find objects based on query
|
java.util.List |
find(java.lang.String query,
java.lang.Object[] values,
org.hibernate.type.Type[] types)
已过时。
Find objects based on query
|
java.util.List |
find(java.lang.String query,
java.lang.Object value,
org.hibernate.type.Type type)
已过时。
Find objects based on query
|
java.lang.Object |
findObject(java.lang.Class theClass,
java.lang.Long key)
已过时。
Find an object.
|
java.lang.Exception |
getError()
已过时。
Get any errors from a previous DB call.
|
org.hibernate.stat.Statistics |
getStatistics()
已过时。
Statistics must be enabled first, when you want to use it.
|
void |
intermediateCommit()
已过时。
Call this to intermediate commit current changes.
|
boolean |
isError()
已过时。
|
java.lang.Object |
loadObject(java.lang.Class theClass,
java.lang.Long key)
已过时。
Load an object.
|
Persistable |
loadObject(Persistable persistable)
已过时。
see DB.loadObject(Persistable persistable, boolean forceReloadFromDB)
|
Persistable |
loadObject(Persistable persistable,
boolean forceReloadFromDB)
已过时。
loads an object if needed. this makes sense if you have an object which had been generated in a previous hibernate session AND you need to access a Set or a
attribute which was defined as a proxy.
|
boolean |
needsCommit()
已过时。
|
void |
removeTransactionListener(ITransactionListener listener)
已过时。
Removes an ITransactionListener from this DB instance.
|
void |
rollback()
已过时。
Call this to rollback current changes.
|
void |
rollbackAndCloseSession()
已过时。
Calls rollback and closes the connection guaranteed.
|
void |
saveObject(java.lang.Object object)
已过时。
Save an object.
|
void |
setSessionFactory(org.hibernate.SessionFactory sessionFactory)
已过时。
[used by spring]
|
void |
updateObject(java.lang.Object object)
已过时。
Update an object.
|
public void closeSession()
closeSession
在接口中 DB
public void cleanUpSession()
DB
cleanUpSession
在接口中 DB
public DBQuery createQuery(java.lang.String query)
createQuery
在接口中 DB
query
- public void deleteObject(java.lang.Object object)
deleteObject
在接口中 DB
object
- public int delete(java.lang.String query, java.lang.Object value, org.hibernate.type.Type type)
public int delete(java.lang.String query, java.lang.Object[] values, org.hibernate.type.Type[] types)
public java.util.List find(java.lang.String query, java.lang.Object value, org.hibernate.type.Type type)
public java.util.List find(java.lang.String query, java.lang.Object[] values, org.hibernate.type.Type[] types)
public java.util.List find(java.lang.String query)
public java.lang.Object findObject(java.lang.Class theClass, java.lang.Long key)
findObject
在接口中 DB
theClass
- key
- public java.lang.Object loadObject(java.lang.Class theClass, java.lang.Long key)
loadObject
在接口中 DB
theClass
- key
- public void saveObject(java.lang.Object object)
saveObject
在接口中 DB
object
- public void updateObject(java.lang.Object object)
updateObject
在接口中 DB
object
- public java.lang.Exception getError()
public boolean isError()
public Persistable loadObject(Persistable persistable)
loadObject
在接口中 DB
persistable
- public Persistable loadObject(Persistable persistable, boolean forceReloadFromDB)
loadObject
在接口中 DB
persistable
- the object which needs to be reloadedforceReloadFromDB
- if true, force a reload from the db (e.g. to catch up to an object commited by another thread which is still in this thread's session cachepublic void commitAndCloseSession()
DB
Use this rather than commit() directly wherever possible!
commitAndCloseSession
在接口中 DB
public void rollbackAndCloseSession()
DB
Note that this method checks whether the connection and the transaction are open and if they're not, then this method doesn't do anything.
rollbackAndCloseSession
在接口中 DB
public void commit()
public org.hibernate.stat.Statistics getStatistics()
getStatistics
在接口中 DB
public void intermediateCommit()
DB
intermediateCommit
在接口中 DB
public void addTransactionListener(ITransactionListener listener)
DB
The ITransactionListener will be informed about commit and rollbacks.
Adding the same listener twice has no effect.
addTransactionListener
在接口中 DB
listener
- the listener to be addedpublic void removeTransactionListener(ITransactionListener listener)
DB
If the ITransactionListener is currently not registered, this call has no effect.
removeTransactionListener
在接口中 DB
public boolean needsCommit()
public void setSessionFactory(org.hibernate.SessionFactory sessionFactory)
sessionFactory
- public void destroy()
Destroyable
destroy
在接口中 Destroyable