|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eobjects.metamodel.AbstractDataContext
org.eobjects.metamodel.QueryPostprocessDataContext
public abstract class QueryPostprocessDataContext
Abstract DataContext for data sources that do not support SQL queries natively. Instead this superclass only requires that a subclass can materialize a single table at a time. Then the query will be executed by post processing the datasets client-side.
| Field Summary | |
|---|---|
static String |
INFORMATION_SCHEMA_NAME
|
| Constructor Summary | |
|---|---|
QueryPostprocessDataContext()
|
|
| Method Summary | |
|---|---|
void |
addConverter(Column column,
TypeConverter<?,?> converter)
Adds a TypeConverter to this DataContext's query engine (Query
Postprocessor) for read operations. |
protected Number |
executeCountQuery(Table table,
List<FilterItem> whereItems,
boolean functionApproximationAllowed)
Executes a simple count query, if possible. |
DataSet |
executeQuery(Query query)
Executes a query against the DataContext. |
protected String |
getDefaultSchemaName()
Gets the name of the default schema. |
protected abstract Schema |
getMainSchema()
|
protected Schema |
getMainSchemaInternal()
|
protected abstract String |
getMainSchemaName()
|
protected Schema |
getSchemaByNameInternal(String name)
Gets a specific schema from the non-abstract implementation. |
protected String[] |
getSchemaNamesInternal()
Gets schema names from the non-abstract implementation. |
protected boolean |
isMainSchemaTable(Table table)
|
protected DataSet |
materializeFromItem(FromItem fromItem,
List<SelectItem> selectItems)
|
protected abstract 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. |
protected DataSet |
materializeMainSchemaTable(Table table,
Column[] columns,
int firstRow,
int maxRows)
Executes a simple one-table query against a table in the main schema of the subclasses of this class. |
protected DataSet |
materializeMainSchemaTable(Table table,
List<SelectItem> selectItems,
int firstRow,
int maxRows)
Executes a simple one-table query against a table in the main schema of the subclasses of this class. |
protected DataSet |
materializeTable(Table table,
List<SelectItem> selectItems,
int firstRow,
int maxRows)
|
| Methods inherited from class org.eobjects.metamodel.AbstractDataContext |
|---|
compileQuery, executeQuery, executeQuery, getColumnByQualifiedLabel, getDefaultSchema, getSchemaByName, getSchemaNames, getSchemas, getTableByQualifiedLabel, isQualifiedPathDelim, parseQuery, query, refreshSchemas |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String INFORMATION_SCHEMA_NAME
| Constructor Detail |
|---|
public QueryPostprocessDataContext()
| Method Detail |
|---|
public DataSet executeQuery(Query query)
DataContext
executeQuery in interface DataContextquery - the query object to execute
DataSet produced from executing the query
protected Number executeCountQuery(Table table,
List<FilterItem> whereItems,
boolean functionApproximationAllowed)
table - the table on which the count is requested.whereItems - a (sometimes empty) list of WHERE items.functionApproximationAllowed - whether approximation is allowed or not.
protected DataSet materializeFromItem(FromItem fromItem,
List<SelectItem> selectItems)
protected DataSet materializeTable(Table table,
List<SelectItem> selectItems,
int firstRow,
int maxRows)
protected boolean isMainSchemaTable(Table table)
protected final String[] getSchemaNamesInternal()
throws MetaModelException
AbstractDataContextAbstractDataContext.refreshSchemas() method is
called.
getSchemaNamesInternal in class AbstractDataContextMetaModelException
protected String getDefaultSchemaName()
throws MetaModelException
AbstractDataContext
getDefaultSchemaName in class AbstractDataContextMetaModelException
protected final Schema getSchemaByNameInternal(String name)
throws MetaModelException
AbstractDataContextAbstractDataContext.refreshSchemas() method is
called.
getSchemaByNameInternal in class AbstractDataContextname - the name of the schema to get
MetaModelExceptionprotected Schema getMainSchemaInternal()
public void addConverter(Column column,
TypeConverter<?,?> converter)
TypeConverter to this DataContext's query engine (Query
Postprocessor) for read operations. Note that this method should NOT be
invoked directly by consuming code. Rather use
Converters.addTypeConverter(DataContext, Column, TypeConverter)
to ensure conversion on both reads and writes.
addConverter in interface HasReadTypeConverters
protected abstract Schema getMainSchema()
throws MetaModelException
MetaModelException
protected abstract String getMainSchemaName()
throws MetaModelException
MetaModelException
protected DataSet materializeMainSchemaTable(Table table,
List<SelectItem> selectItems,
int firstRow,
int maxRows)
materializeMainSchemaTable(Table, Column[], int, int).
table - selectItems - firstRow - maxRows -
protected DataSet materializeMainSchemaTable(Table table,
Column[] columns,
int firstRow,
int maxRows)
materializeMainSchemaTable(Table, Column[], int) and apply a
FirstRowDataSet if necessary.
table - columns - firstRow - maxRows -
protected abstract DataSet materializeMainSchemaTable(Table table,
Column[] columns,
int maxRows)
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.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||