|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface DataContext
A DataContext represents the central entry point for interactions with datastores. The DataContext contains of the structure of data (in the form of schemas) and interactions (in the form of queries) with data.
| Method Summary | |
|---|---|
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. |
String[] |
getSchemaNames()
Gets the names of all schemas within this DataContext. |
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. |
| Method Detail |
|---|
DataContext refreshSchemas()
Schema[] getSchemas()
throws MetaModelException
MetaModelException - if an error occurs retrieving the schema model
String[] getSchemaNames()
throws MetaModelException
MetaModelException - if an error occurs retrieving the schema model
Schema getDefaultSchema()
throws MetaModelException
MetaModelException - if an error occurs retrieving the schema model
Schema getSchemaByName(String name)
throws MetaModelException
name - the name of the desired schema
MetaModelException - if an error occurs retrieving the schema modelInitFromBuilder query()
Query parseQuery(String queryString)
throws MetaModelException
Query object.
queryString - the SQL query to parse
Query object corresponding to the SQL query.
MetaModelException - in case the parsing was unsuccesful.
DataSet executeQuery(Query query)
throws MetaModelException
query - the query object to execute
DataSet produced from executing the query
MetaModelException - 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 query
MetaModelException - if preparing the query is unsuccesfulCompiledQuery,
QueryParameter
DataSet 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.
query - the SQL query to parse
DataSet produced from executing the query
MetaModelException - if either parsing or executing the query produces an
exceptionColumn getColumnByQualifiedLabel(String columnName)
columnName -
Table getTableByQualifiedLabel(String tableName)
tableName -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||