public abstract class QAbstractDataContext extends Object implements QDataContext
| Modifier | Constructor and Description |
|---|---|
protected |
QAbstractDataContext(QDataContextFactory contextFactory) |
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(IQDataContextListener qDataContextListener)
Add a listener to keep track of the events on an instance.
|
void |
attach(Object o)
If the object was from an earlier database session reattach it to another, live session.
|
void |
delete(Object o)
Cause the object to be deleted from the database.
|
<T> T |
find(Class<T> clz,
Object pk)
Load the persistent object with the specified type and primary key from the database.
|
<T> T |
find(ICriteriaTableDef<T> metatable,
Object pk) |
<T> T |
get(Class<T> clz,
Object pk)
Load the persistent object with the specified type and primary key from the database.
|
QDataContextFactory |
getFactory()
Returns the context source which created this DataContext.
|
protected QQueryExecutorRegistry |
getHandlerFactory() |
<T> T |
getInstance(Class<T> clz,
Object pk)
Load the persistent object with the specified type and primary key from the database.
|
<T> T |
getInstance(ICriteriaTableDef<T> metatable,
Object pk) |
<R> List<R> |
query(Class<R> resultInterface,
QSelection<?> sel)
Query a selection, and return the result in the specified proxied interface.
|
<T> List<T> |
query(QCriteria<T> q)
Execute the query specified by q and return a list of results.
|
List<Object[]> |
query(QSelection<?> sel)
Issue a selection query, where multiple fields or projections on fields are selected from a base class.
|
<R> R |
queryOne(Class<R> resultInterface,
QSelection<?> sel)
Query a selection, and return the result in the specified proxied interface.
|
<T> T |
queryOne(QCriteria<T> q)
Execute the query specified by q, and expect and return at most 1 result.
|
Object[] |
queryOne(QSelection<?> sel)
Execute the selection query specified by q, and expect and return at most 1 result.
|
void |
refresh(Object o)
EXPERIMENTAL/NOT FINAL Refresh with latest content in the database.
|
void |
save(Object o)
Cause the object to be inserted in the database.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddCommitAction, close, commit, getConnection, inTransaction, original, rollback, setIgnoreClose, setKeepOriginals, startTransactionprotected QAbstractDataContext(QDataContextFactory contextFactory)
protected QQueryExecutorRegistry getHandlerFactory()
@Nonnull public QDataContextFactory getFactory()
getFactory in interface QDataContextpublic <T> T find(@Nonnull Class<T> clz, @Nonnull Object pk) throws Exception
find in interface QDataContextT - The object type.clz - The persistent class for which an instance is being sought.pk - The PK for the instance required.ExceptionQDataContext.find(java.lang.Class, java.lang.Object)@Nonnull public <T> T get(@Nonnull Class<T> clz, @Nonnull Object pk) throws Exception
QNotFoundException.get in interface QDataContextT - The object type.clz - The persistent class for which an instance is being sought.pk - The PK for the instance required.ExceptionQDataContext.get(java.lang.Class, java.lang.Object)public <T> T find(@Nonnull ICriteriaTableDef<T> metatable, @Nonnull Object pk) throws Exception
find in interface QDataContextException@Nonnull public <T> T getInstance(@Nonnull Class<T> clz, @Nonnull Object pk) throws Exception
QDataContext.find(Class, Object).getInstance in interface QDataContextT - The object typeclz - The persistent class for which an instance is being sought.pk - The PK for the instance required.ExceptionQDataContext.getInstance(java.lang.Class, java.lang.Object)@Nonnull public <T> T getInstance(@Nonnull ICriteriaTableDef<T> metatable, @Nonnull Object pk) throws Exception
getInstance in interface QDataContextException@Nonnull public <T> List<T> query(@Nonnull QCriteria<T> q) throws Exception
query in interface QDataContextT - The return type for this query, a persistent class typeq - The selection criteriaExceptionQDataContext.query(to.etc.webapp.query.QCriteria)@Nonnull public List<Object[]> query(@Nonnull QSelection<?> sel) throws Exception
query in interface QDataContextExceptionQDataContext.query(to.etc.webapp.query.QSelection)@Nonnull public <R> List<R> query(@Nonnull Class<R> resultInterface, @Nonnull QSelection<?> sel) throws Exception
QDataContextQFld annotations to define the order in the result set.query in interface QDataContextException@Nullable public <R> R queryOne(@Nonnull Class<R> resultInterface, @Nonnull QSelection<?> sel) throws Exception
QDataContextQFld annotations to define the order in the result set.queryOne in interface QDataContextExceptionpublic <T> T queryOne(@Nonnull QCriteria<T> q) throws Exception
queryOne in interface QDataContextExceptionQDataContext.queryOne(to.etc.webapp.query.QCriteria)public Object[] queryOne(@Nonnull QSelection<?> sel) throws Exception
queryOne in interface QDataContextExceptionQDataContext.queryOne(to.etc.webapp.query.QCriteria)public void attach(@Nonnull Object o) throws Exception
attach in interface QDataContextExceptionQDataContext.attach(java.lang.Object)public void delete(@Nonnull Object o) throws Exception
delete in interface QDataContextExceptionQDataContext.delete(java.lang.Object)public void save(@Nonnull Object o) throws Exception
save in interface QDataContextExceptionQDataContext.save(java.lang.Object)public void refresh(@Nonnull Object o) throws Exception
refresh in interface QDataContextExceptionQDataContext.refresh(java.lang.Object)public void addListener(@Nonnull IQDataContextListener qDataContextListener)
addListener in interface QDataContextQDataContext.addListener(to.etc.webapp.query.IQDataContextListener)Copyright © 2017 etc.to. All rights reserved.