public class InterceptableDataContext extends Object implements UpdateableDataContext
| Modifier | Constructor and Description |
|---|---|
protected |
InterceptableDataContext(DataContext delegate) |
protected InterceptableDataContext(DataContext delegate)
public InterceptableDataContext addTableCreationInterceptor(TableCreationInterceptor interceptor)
public InterceptableDataContext removeTableCreationInterceptor(TableCreationInterceptor interceptor)
public InterceptableDataContext addTableDropInterceptor(TableDropInterceptor interceptor)
public InterceptableDataContext removeTableDropInterceptor(TableDropInterceptor interceptor)
public InterceptableDataContext addRowInsertionInterceptor(RowInsertionInterceptor interceptor)
public InterceptableDataContext removeRowInsertionInterceptor(RowInsertionInterceptor interceptor)
public InterceptableDataContext addRowUpdationInterceptor(RowUpdationInterceptor interceptor)
public InterceptableDataContext removeRowUpdationInterceptor(RowUpdationInterceptor interceptor)
public InterceptableDataContext addRowDeletionInterceptor(RowDeletionInterceptor interceptor)
public InterceptableDataContext removeRowDeletionInterceptor(RowDeletionInterceptor interceptor)
public InterceptableDataContext addQueryInterceptor(QueryInterceptor interceptor)
public InterceptableDataContext removeQueryInterceptor(QueryInterceptor interceptor)
public InterceptableDataContext addSchemaInterceptor(SchemaInterceptor interceptor)
public InterceptableDataContext removeSchemaInterceptor(SchemaInterceptor interceptor)
public InterceptableDataContext addDataSetInterceptor(DataSetInterceptor interceptor)
public InterceptableDataContext removeDataSetInterceptor(DataSetInterceptor interceptor)
public InterceptorList<DataSet> getDataSetInterceptors()
public InterceptorList<Query> getQueryInterceptors()
public InterceptorList<RowInsertionBuilder> getRowInsertionInterceptors()
public InterceptorList<RowUpdationBuilder> getRowUpdationInterceptors()
public InterceptorList<RowDeletionBuilder> getRowDeletionInterceptors()
public InterceptorList<Schema> getSchemaInterceptors()
public InterceptorList<TableCreationBuilder> getTableCreationInterceptors()
public DataContext getDelegate()
public DataSet executeQuery(Query query) throws MetaModelException
DataContextexecuteQuery in interface DataContextquery - the query object to executeDataSet produced from executing the queryMetaModelException - if the specified query does not make sense or cannot be
executed because of restraints on the type of datastore.public UpdateableDataContext refreshSchemas()
DataContextrefreshSchemas in interface DataContextpublic List<Schema> getSchemas() throws MetaModelException
DataContextgetSchemas in interface DataContextMetaModelException - if an error occurs retrieving the schema modelpublic List<String> getSchemaNames() throws MetaModelException
DataContextgetSchemaNames in interface DataContextMetaModelException - if an error occurs retrieving the schema modelpublic Schema getDefaultSchema() throws MetaModelException
DataContextgetDefaultSchema in interface DataContextMetaModelException - if an error occurs retrieving the schema modelpublic Schema getSchemaByName(String name) throws MetaModelException
DataContextgetSchemaByName in interface DataContextname - the name of the desired schemaMetaModelException - if an error occurs retrieving the schema modelpublic InitFromBuilder query()
DataContextquery in interface DataContextpublic Column getColumnByQualifiedLabel(String columnName)
DataContextgetColumnByQualifiedLabel in interface DataContextpublic Table getTableByQualifiedLabel(String tableName)
DataContextgetTableByQualifiedLabel in interface DataContextpublic UpdateSummary executeUpdate(UpdateScript update)
UpdateableDataContextUpdateScript for execution on the DataContext.
Since implementations of the DataContext vary quite a lot, there
is no golden rule as to how an update script will be executed. But the
implementors should strive towards handling an UpdateScript as a
single transactional change to the data store.executeUpdate in interface UpdateableDataContextupdate - the update script to executepublic Query parseQuery(String queryString) throws MetaModelException
DataContextQuery object.parseQuery in interface DataContextqueryString - the SQL query to parseQuery object corresponding to the SQL query.MetaModelException - in case the parsing was unsuccesful.public DataSet executeQuery(String queryString) throws MetaModelException
DataContextDataContext.parseQuery(String) and then DataContext.executeQuery(Query) with
the parsed query.executeQuery in interface DataContextqueryString - the SQL query to parseDataSet produced from executing the queryMetaModelException - if either parsing or executing the query produces an
exceptionpublic CompiledQuery compileQuery(Query query)
DataContextQueryParameters as operands in the
WHERE clause, making it possible to reuse the same query with different
parameter values.compileQuery in interface DataContextquery - the query object to execute, possibly holding one or more
QueryParameters.CompiledQuery after preparing the queryCompiledQuery,
QueryParameterpublic DataSet executeQuery(CompiledQuery compiledQuery, Object... values)
DataContextexecuteQuery in interface DataContextcompiledQuery - the compiledQuery object to executevalues - the values for parameters in the CompiledQuery.DataSet produced from executing the query.Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.