@InterfaceStability.Stable public interface DataContext
| Modifier and Type | Method and Description |
|---|---|
CompiledQuery |
compileQuery(Query query)
Compiles a query, preparing it for reuse.
|
DataSet |
executeQuery(CompiledQuery compiledQuery,
Object... values)
Executes a compiled query with given values as parameters.
|
DataSet |
executeQuery(Query query)
Executes a query against the DataContext.
|
DataSet |
executeQuery(String queryString)
Parses and executes a string-based SQL query.
|
Column |
getColumnByQualifiedLabel(String columnName)
Finds a column in the DataContext based on a fully qualified column
label.
|
Schema |
getDefaultSchema()
Gets the default schema of this DataContext.
|
Schema |
getSchemaByName(String name)
Gets a schema by a specified name.
|
List<String> |
getSchemaNames()
Gets the names of all schemas within this DataContext.
|
List<Schema> |
getSchemas()
Gets all schemas within this DataContext.
|
Table |
getTableByQualifiedLabel(String tableName)
Finds a table in the DataContext based on a fully qualified table label.
|
Query |
parseQuery(String queryString)
Parses a string-based SQL query and produces a corresponding
Query object. |
InitFromBuilder |
query()
Starts building a query using the query builder API.
|
DataContext |
refreshSchemas()
Enforces a refresh of the schemas.
|
DataContext refreshSchemas()
List<Schema> getSchemas() throws MetaModelException
MetaModelException - if an error occurs retrieving the schema modelList<String> getSchemaNames() throws MetaModelException
MetaModelException - if an error occurs retrieving the schema modelSchema getDefaultSchema() throws MetaModelException
MetaModelException - if an error occurs retrieving the schema modelSchema getSchemaByName(String name) throws MetaModelException
name - the name of the desired schemaMetaModelException - if an error occurs retrieving the schema modelInitFromBuilder query()
Query parseQuery(String queryString) throws MetaModelException
Query object.queryString - the SQL query to parseQuery object corresponding to the SQL query.MetaModelException - in case the parsing was unsuccesful.DataSet executeQuery(Query query) throws MetaModelException
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.CompiledQuery compileQuery(Query query) throws MetaModelException
QueryParameters as operands in the
WHERE clause, making it possible to reuse the same query with different
parameter values.query - the query object to execute, possibly holding one or more
QueryParameters.CompiledQuery after preparing the queryMetaModelException - if preparing the query is unsuccesfulCompiledQuery,
QueryParameterDataSet executeQuery(CompiledQuery compiledQuery, Object... values)
compiledQuery - the compiledQuery object to executevalues - the values for parameters in the CompiledQuery.DataSet produced from executing the query.DataSet executeQuery(String queryString) throws MetaModelException
parseQuery(String) and then executeQuery(Query) with
the parsed query.queryString - the SQL query to parseDataSet produced from executing the queryMetaModelException - if either parsing or executing the query produces an
exceptionColumn getColumnByQualifiedLabel(String columnName)
columnName - Table getTableByQualifiedLabel(String tableName)
tableName - Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.