|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface QDataContext
Generalized thingy representing a database connection, and state associated with objects. Equals the "DataContext" or "Hibernate Session". This is a controlled resource.
Method Summary | ||
---|---|---|
void |
addCommitAction(IRunnable cx)
Add an action which should be executed after a succesful commit on this context. |
|
void |
attach(java.lang.Object o)
If the object was from an earlier database session reattach it to another, live session. |
|
void |
close()
This will close and fully discard all resources belonging to this context, provided ignoreClose is not true. |
|
void |
commit()
|
|
void |
delete(java.lang.Object o)
EXPERIMENTAL/NOT FINAL Cause the object to be deleted from the database. |
|
|
find(java.lang.Class<T> clz,
java.lang.Object pk)
Load the persistent object with the specified type and primary key from the database. |
|
|
find(ICriteriaTableDef<T> metatable,
java.lang.Object pk)
|
|
java.sql.Connection |
getConnection()
|
|
QDataContextFactory |
getFactory()
Returns the context source which created this DataContext. |
|
|
getInstance(java.lang.Class<T> clz,
java.lang.Object pk)
Load the persistent object with the specified type and primary key from the database. |
|
|
getInstance(ICriteriaTableDef<T> clz,
java.lang.Object pk)
|
|
boolean |
inTransaction()
|
|
|
query(QCriteria<T> q)
Execute the query specified by q and return a list of results. |
|
java.util.List<java.lang.Object[]> |
query(QSelection<?> sel)
Issue a selection query, where multiple fields or projections on fields are selected from a base class. |
|
|
queryOne(QCriteria<T> q)
Execute the query specified by q, and expect and return at most 1 result. |
|
java.lang.Object[] |
queryOne(QSelection<?> q)
Execute the selection query specified by q, and expect and return at most 1 result. |
|
void |
refresh(java.lang.Object o)
Deprecated. |
|
void |
rollback()
|
|
void |
save(java.lang.Object o)
EXPERIMENTAL/NOT FINAL Cause the object to be inserted in the database. |
|
void |
setIgnoreClose(boolean on)
When ignoreClose is set to T the close call must be silently ignored. |
|
void |
startTransaction()
|
Method Detail |
---|
QDataContextFactory getFactory()
void setIgnoreClose(boolean on)
on
- void close()
<T> java.util.List<T> query(QCriteria<T> q) throws java.lang.Exception
T
- The return type for this query, a persistent class typeq
- The selection criteria
java.lang.Exception
<T> T queryOne(QCriteria<T> q) throws java.lang.Exception
T
- q
-
java.lang.Exception
java.util.List<java.lang.Object[]> query(QSelection<?> sel) throws java.lang.Exception
sel
-
java.lang.Exception
java.lang.Object[] queryOne(QSelection<?> q) throws java.lang.Exception
T
- q
-
java.lang.Exception
<T> T find(java.lang.Class<T> clz, java.lang.Object pk) throws java.lang.Exception
T
- The object type.clz
- The persistent class for which an instance is being sought.pk
- The PK for the instance required.
java.lang.Exception
<T> T find(ICriteriaTableDef<T> metatable, java.lang.Object pk) throws java.lang.Exception
java.lang.Exception
<T> T getInstance(java.lang.Class<T> clz, java.lang.Object pk) throws java.lang.Exception
find(Class, Object)
.
T
- The object typeclz
- The persistent class for which an instance is being sought.pk
- The PK for the instance required.
java.lang.Exception
<T> T getInstance(ICriteriaTableDef<T> clz, java.lang.Object pk) throws java.lang.Exception
java.lang.Exception
void attach(java.lang.Object o) throws java.lang.Exception
o
-
java.lang.Exception
void save(java.lang.Object o) throws java.lang.Exception
o
-
java.lang.Exception
@Deprecated void refresh(java.lang.Object o) throws java.lang.Exception
o
-
java.lang.Exception
void delete(java.lang.Object o) throws java.lang.Exception
o
-
java.lang.Exception
void startTransaction() throws java.lang.Exception
java.lang.Exception
void commit() throws java.lang.Exception
java.lang.Exception
void rollback() throws java.lang.Exception
java.lang.Exception
boolean inTransaction() throws java.lang.Exception
java.lang.Exception
java.sql.Connection getConnection() throws java.lang.Exception
java.lang.Exception
void addCommitAction(IRunnable cx)
cx
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |