public class PojoDataContext extends QueryPostprocessDataContext implements UpdateableDataContext, Serializable
DataContext
used to serve MetaModel support for collections of Java
objects and key/value maps.INFORMATION_SCHEMA_NAME
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) |
void |
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,
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, getMainSchemaInternal, getSchemaByNameInternal, getSchemaNamesInternal, isMainSchemaTable, materializeFromItem, materializeMainSchemaTable, materializeMainSchemaTable, materializeTable
compileQuery, executeQuery, executeQuery, getColumnByQualifiedLabel, getDefaultSchema, getSchemaByName, getSchemaNames, getSchemas, getTableByQualifiedLabel, isQualifiedPathDelim, 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 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, 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 void 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–2014 The Apache Software Foundation. All rights reserved.