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
TableDataProvider s. |
PojoDataContext(String schemaName,
List<TableDataProvider<?>> tables)
Creates a new POJO data context based on the provided
TableDataProvider s. |
PojoDataContext(String schemaName,
TableDataProvider... tableProviders)
Creates a new POJO data context based on the provided
TableDataProvider s. |
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, materializeTable
compileQuery, executeQuery, executeQuery, getColumnByQualifiedLabel, getDefaultSchema, getSchemaByName, getSchemaNames, getSchemas, getTableByQualifiedLabel, isQualifiedPathDelim, onSchemaCacheRefreshed, parseQuery, query, refreshSchemas
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
compileQuery, executeQuery, executeQuery, executeQuery, getColumnByQualifiedLabel, getDefaultSchema, getSchemaByName, getSchemaNames, getSchemas, getTableByQualifiedLabel, parseQuery, query, refreshSchemas
public static final String DEFAULT_SCHEMA_NAME
public PojoDataContext()
public PojoDataContext(List<TableDataProvider<?>> tables)
TableDataProvider
s.tables
- public PojoDataContext(String schemaName, TableDataProvider... tableProviders)
TableDataProvider
s.schemaName
- the name of the created schematableProviders
- public PojoDataContext(String schemaName, List<TableDataProvider<?>> tables)
TableDataProvider
s.schemaName
- the name of the created schematables
- protected DataSet materializeMainSchemaTable(Table table, List<Column> columns, int maxRows)
QueryPostprocessDataContext
materializeMainSchemaTable
in class QueryPostprocessDataContext
table
- 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 QueryPostprocessDataContext
MetaModelException
protected String getMainSchemaName() throws MetaModelException
getMainSchemaName
in class QueryPostprocessDataContext
MetaModelException
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 executeprotected void addTableDataProvider(TableDataProvider<?> tableDataProvider)
Copyright © 2007–2021 The Apache Software Foundation. All rights reserved.