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
DataContext
executeQuery
in interface DataContext
query
- 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()
DataContext
refreshSchemas
in interface DataContext
public Schema[] getSchemas() throws MetaModelException
DataContext
getSchemas
in interface DataContext
MetaModelException
- if an error occurs retrieving the schema modelpublic String[] getSchemaNames() throws MetaModelException
DataContext
getSchemaNames
in interface DataContext
MetaModelException
- if an error occurs retrieving the schema modelpublic Schema getDefaultSchema() throws MetaModelException
DataContext
getDefaultSchema
in interface DataContext
MetaModelException
- if an error occurs retrieving the schema modelpublic Schema getSchemaByName(String name) throws MetaModelException
DataContext
getSchemaByName
in interface DataContext
name
- the name of the desired schemaMetaModelException
- if an error occurs retrieving the schema modelpublic InitFromBuilder query()
DataContext
query
in interface DataContext
public Column getColumnByQualifiedLabel(String columnName)
DataContext
getColumnByQualifiedLabel
in interface DataContext
public Table getTableByQualifiedLabel(String tableName)
DataContext
getTableByQualifiedLabel
in interface DataContext
public UpdateSummary executeUpdate(UpdateScript update)
UpdateableDataContext
UpdateScript
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 UpdateableDataContext
update
- the update script to executepublic Query parseQuery(String queryString) throws MetaModelException
DataContext
Query
object.parseQuery
in interface DataContext
queryString
- 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
DataContext
DataContext.parseQuery(String)
and then DataContext.executeQuery(Query)
with
the parsed query.executeQuery
in interface DataContext
queryString
- the SQL query to parseDataSet
produced from executing the queryMetaModelException
- if either parsing or executing the query produces an
exceptionpublic CompiledQuery compileQuery(Query query)
DataContext
QueryParameter
s as operands in the
WHERE clause, making it possible to reuse the same query with different
parameter values.compileQuery
in interface DataContext
query
- the query object to execute, possibly holding one or more
QueryParameter
s.CompiledQuery
after preparing the queryCompiledQuery
,
QueryParameter
public DataSet executeQuery(CompiledQuery compiledQuery, Object... values)
DataContext
executeQuery
in interface DataContext
compiledQuery
- the compiledQuery object to executevalues
- the values for parameters in the CompiledQuery
.DataSet
produced from executing the query.Copyright © 2007–2017 The Apache Software Foundation. All rights reserved.