public class PojoDataContext extends QueryPostprocessDataContext implements UpdateableDataContext, Serializable
DataContext used to serve MetaModel support for collections of Java
objects and key/value maps.| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_SCHEMA_NAME |
INFORMATION_SCHEMA_NAME, SYSTEM_PROPERTY_CREATE_DEFAULT_TABLE_ALIAS| Constructor and Description |
|---|
PojoDataContext()
Creates a new POJO data context that is empty but can be populated at
will.
|
PojoDataContext(List<TableDataProvider<?>> tables)
Creates a new POJO data context based on the provided
TableDataProviders. |
PojoDataContext(String schemaName,
List<TableDataProvider<?>> tables)
Creates a new POJO data context based on the provided
TableDataProviders. |
PojoDataContext(String schemaName,
TableDataProvider... tableProviders)
Creates a new POJO data context based on the provided
TableDataProviders. |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addTableDataProvider(TableDataProvider<?> tableDataProvider) |
UpdateSummary |
executeUpdate(UpdateScript update)
Submits an
UpdateScript for execution on the DataContext. |
protected Schema |
getMainSchema() |
protected String |
getMainSchemaName() |
void |
insert(String tableName,
Map<String,Object> recordData) |
protected DataSet |
materializeMainSchemaTable(Table table,
List<Column> columns,
int maxRows)
Executes a simple one-table query against a table in the main schema of the subclasses of this class.
|
addConverter, executeCountQuery, executePrimaryKeyLookupQuery, executeQuery, getDefaultSchemaName, getSchemaByNameInternal, getSchemaNamesInternal, isMainSchemaTable, isScalarFunctionMaterialized, materializeFromItem, materializeMainSchemaTable, materializeMainSchemaTable, materializeMainSchemaTableSelect, materializeTablecompileQuery, executeQuery, executeQuery, getColumnByQualifiedLabel, getDefaultSchema, getSchemaByName, getSchemaNames, getSchemas, getTableByQualifiedLabel, isQualifiedPathDelim, onSchemaCacheRefreshed, parseQuery, query, refreshSchemasclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcompileQuery, executeQuery, executeQuery, executeQuery, getColumnByQualifiedLabel, getDefaultSchema, getSchemaByName, getSchemaNames, getSchemas, getTableByQualifiedLabel, parseQuery, query, refreshSchemaspublic static final String DEFAULT_SCHEMA_NAME
public PojoDataContext()
public PojoDataContext(List<TableDataProvider<?>> tables)
TableDataProviders.tables - public PojoDataContext(String schemaName, TableDataProvider... tableProviders)
TableDataProviders.schemaName - the name of the created schematableProviders - public PojoDataContext(String schemaName, List<TableDataProvider<?>> tables)
TableDataProviders.schemaName - the name of the created schematables - protected DataSet materializeMainSchemaTable(Table table, List<Column> columns, int maxRows)
QueryPostprocessDataContextmaterializeMainSchemaTable in class QueryPostprocessDataContexttable - the table to querycolumns - the columns of the table to querymaxRows - the maximum amount of rows needed or -1 if all rows are wanted.protected Schema getMainSchema() throws MetaModelException
getMainSchema in class QueryPostprocessDataContextMetaModelExceptionprotected String getMainSchemaName() throws MetaModelException
getMainSchemaName in class QueryPostprocessDataContextMetaModelExceptionpublic 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 executeprotected void addTableDataProvider(TableDataProvider<?> tableDataProvider)
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.