public abstract class MetaImpl extends Object implements Meta
Meta
.
Each sub-class must implement the two remaining abstract methods,
Meta.prepare(org.apache.calcite.avatica.Meta.ConnectionHandle, java.lang.String, long)
and
Meta.prepareAndExecute(org.apache.calcite.avatica.Meta.StatementHandle, java.lang.String, long, org.apache.calcite.avatica.Meta.PrepareCallback)
.
It should also override metadata methods such as getCatalogs(Meta.ConnectionHandle)
and
getTables(org.apache.calcite.avatica.Meta.ConnectionHandle, java.lang.String, org.apache.calcite.avatica.Meta.Pat, org.apache.calcite.avatica.Meta.Pat, java.util.List<java.lang.String>)
for the element types for which it has instances; the
default metadata methods return empty collections.
Modifier and Type | Class and Description |
---|---|
static interface |
MetaImpl.ColumnNoNulls
Annotation that indicates that a meta field may not contain null
values.
|
static interface |
MetaImpl.ColumnNullable
Annotation that indicates that a meta field may contain null values.
|
static interface |
MetaImpl.ColumnNullableUnknown
Annotation that indicates that it is unknown whether a meta field may contain
null values.
|
static class |
MetaImpl.MetaAttribute
Metadata describing an attribute.
|
static class |
MetaImpl.MetaBestRowIdentifier
Metadata describing the best identifier for a row.
|
static class |
MetaImpl.MetaCatalog
Metadata describing a catalog.
|
static class |
MetaImpl.MetaClientInfoProperty
Metadata describing a client info property.
|
static class |
MetaImpl.MetaColumn
Metadata describing a column.
|
static class |
MetaImpl.MetaColumnPrivilege
Metadata describing a column privilege.
|
static class |
MetaImpl.MetaCrossReference
Metadata describing a cross reference.
|
static class |
MetaImpl.MetaExportedKey
Metadata describing an exported key.
|
static class |
MetaImpl.MetaFunction
Metadata describing a function.
|
static class |
MetaImpl.MetaFunctionColumn
Metadata describing a function column.
|
static class |
MetaImpl.MetaImportedKey
Metadata describing an imported key.
|
static class |
MetaImpl.MetaIndexInfo
Metadata describing index info.
|
static class |
MetaImpl.MetaPrimaryKey
Metadata describing a primary key.
|
static class |
MetaImpl.MetaProcedure
Metadata describing a procedure.
|
static class |
MetaImpl.MetaProcedureColumn
Metadata describing a procedure column.
|
static class |
MetaImpl.MetaPseudoColumn
Metadata describing a pseudo column.
|
static class |
MetaImpl.MetaSchema
Metadata describing a schema.
|
static class |
MetaImpl.MetaSuperTable
Metadata describing a super-table.
|
static class |
MetaImpl.MetaSuperType
Metadata describing a super-type.
|
static class |
MetaImpl.MetaTable
Metadata describing a table.
|
static class |
MetaImpl.MetaTablePrivilege
Metadata describing a table privilege.
|
static class |
MetaImpl.MetaTableType
Metadata describing a table type.
|
static class |
MetaImpl.MetaTypeInfo
Metadata describing type info.
|
static class |
MetaImpl.MetaUdt
Metadata describing a user-defined type.
|
static class |
MetaImpl.MetaVersionColumn
Metadata describing a version column.
|
static interface |
MetaImpl.Named
An object that has a name.
|
Meta.ConnectionHandle, Meta.ConnectionProperties, Meta.CursorFactory, Meta.DatabaseProperty, Meta.ExecuteBatchResult, Meta.ExecuteResult, Meta.Factory, Meta.Frame, Meta.MetaResultSet, Meta.Pat, Meta.PrepareCallback, Meta.Signature, Meta.StatementHandle, Meta.StatementType, Meta.Style
Modifier and Type | Field and Description |
---|---|
protected AvaticaConnection |
connection
The
AvaticaConnection backing this . |
protected ConnectionPropertiesImpl |
connProps
Represents the various states specific to
connection . |
Constructor and Description |
---|
MetaImpl(AvaticaConnection connection) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
closeStatement, commit, execute, execute, executeBatch, fetch, prepare, prepareAndExecute, prepareAndExecute, prepareAndExecuteBatch, rollback, syncResults
protected final AvaticaConnection connection
AvaticaConnection
backing this
.protected final ConnectionPropertiesImpl connProps
connection
.
Note: this instance is used recursively with connection
's getter and setter
methods.
public MetaImpl(AvaticaConnection connection)
public static Cursor createCursor(Meta.CursorFactory cursorFactory, Iterable<Object> iterable)
public static List<List<Object>> collect(Meta.CursorFactory cursorFactory, Iterator<Object> iterator, List<List<Object>> list)
public static List<List<Object>> collect(Meta.CursorFactory cursorFactory, Iterable<Object> iterable, List<List<Object>> list)
public void openConnection(Meta.ConnectionHandle ch, Map<String,String> info)
Meta
Meta.ConnectionHandle
. The Map info
argument is
analogous to the Properties
typically passed to a "normal" JDBC Driver. Avatica
specific properties should not be included -- only properties for the underlying driver.openConnection
in interface Meta
ch
- A ConnectionHandle encapsulates information about the connection to be opened
as provided by the client.info
- A Map corresponding to the Properties typically passed to a JDBC Driver.public void closeConnection(Meta.ConnectionHandle ch)
Meta
closeConnection
in interface Meta
public Meta.ConnectionProperties connectionSync(Meta.ConnectionHandle ch, Meta.ConnectionProperties connProps)
Meta
Note: this interface is considered "experimental" and may undergo further changes as this
functionality is extended to other aspects of state management for
Connection
, Statement
, and ResultSet
.
connectionSync
in interface Meta
public Meta.StatementHandle createStatement(Meta.ConnectionHandle ch)
Meta
createStatement
in interface Meta
ch
- Connection handleprotected <E> Meta.MetaResultSet createEmptyResultSet(Class<E> clazz)
public static ColumnMetaData columnMetaData(String name, int index, Class<?> type, boolean columnNullable)
public static ColumnMetaData columnMetaData(String name, int index, ColumnMetaData.AvaticaType type, boolean columnNullable)
public static ColumnMetaData columnMetaData(String name, int index, Class<?> type, int columnNullable)
public static ColumnMetaData columnMetaData(String name, int index, ColumnMetaData.AvaticaType type, int columnNullable)
protected static ColumnMetaData.StructType fieldMetaData(Class<?> clazz)
protected static int getColumnNullability(Field field)
protected Meta.MetaResultSet createResultSet(Map<String,Object> internalParameters, List<ColumnMetaData> columns, Meta.CursorFactory cursorFactory, Meta.Frame firstFrame)
public Map<Meta.DatabaseProperty,Object> getDatabaseProperties(Meta.ConnectionHandle ch)
Meta
The provider can omit properties whose value is the same as the default.
getDatabaseProperties
in interface Meta
public Meta.MetaResultSet getTables(Meta.ConnectionHandle ch, String catalog, Meta.Pat schemaPattern, Meta.Pat tableNamePattern, List<String> typeList)
Meta
public Meta.MetaResultSet getColumns(Meta.ConnectionHandle ch, String catalog, Meta.Pat schemaPattern, Meta.Pat tableNamePattern, Meta.Pat columnNamePattern)
Meta
getColumns
in interface Meta
public Meta.MetaResultSet getSchemas(Meta.ConnectionHandle ch, String catalog, Meta.Pat schemaPattern)
getSchemas
in interface Meta
public Meta.MetaResultSet getCatalogs(Meta.ConnectionHandle ch)
Meta
getCatalogs
in interface Meta
public Meta.MetaResultSet getTableTypes(Meta.ConnectionHandle ch)
Meta
getTableTypes
in interface Meta
public Meta.MetaResultSet getProcedures(Meta.ConnectionHandle ch, String catalog, Meta.Pat schemaPattern, Meta.Pat procedureNamePattern)
Meta
getProcedures
in interface Meta
public Meta.MetaResultSet getProcedureColumns(Meta.ConnectionHandle ch, String catalog, Meta.Pat schemaPattern, Meta.Pat procedureNamePattern, Meta.Pat columnNamePattern)
Meta
getProcedureColumns
in interface Meta
public Meta.MetaResultSet getColumnPrivileges(Meta.ConnectionHandle ch, String catalog, String schema, String table, Meta.Pat columnNamePattern)
Meta
getColumnPrivileges
in interface Meta
public Meta.MetaResultSet getTablePrivileges(Meta.ConnectionHandle ch, String catalog, Meta.Pat schemaPattern, Meta.Pat tableNamePattern)
Meta
getTablePrivileges
in interface Meta
public Meta.MetaResultSet getBestRowIdentifier(Meta.ConnectionHandle ch, String catalog, String schema, String table, int scope, boolean nullable)
Meta
getBestRowIdentifier
in interface Meta
public Meta.MetaResultSet getVersionColumns(Meta.ConnectionHandle ch, String catalog, String schema, String table)
Meta
getVersionColumns
in interface Meta
public Meta.MetaResultSet getPrimaryKeys(Meta.ConnectionHandle ch, String catalog, String schema, String table)
Meta
getPrimaryKeys
in interface Meta
public Meta.MetaResultSet getImportedKeys(Meta.ConnectionHandle ch, String catalog, String schema, String table)
Meta
getImportedKeys
in interface Meta
public Meta.MetaResultSet getExportedKeys(Meta.ConnectionHandle ch, String catalog, String schema, String table)
Meta
getExportedKeys
in interface Meta
public Meta.MetaResultSet getCrossReference(Meta.ConnectionHandle ch, String parentCatalog, String parentSchema, String parentTable, String foreignCatalog, String foreignSchema, String foreignTable)
Meta
getCrossReference
in interface Meta
public Meta.MetaResultSet getTypeInfo(Meta.ConnectionHandle ch)
Meta
getTypeInfo
in interface Meta
public Meta.MetaResultSet getIndexInfo(Meta.ConnectionHandle ch, String catalog, String schema, String table, boolean unique, boolean approximate)
Meta
getIndexInfo
in interface Meta
public Meta.MetaResultSet getUDTs(Meta.ConnectionHandle ch, String catalog, Meta.Pat schemaPattern, Meta.Pat typeNamePattern, int[] types)
Meta
public Meta.MetaResultSet getSuperTypes(Meta.ConnectionHandle ch, String catalog, Meta.Pat schemaPattern, Meta.Pat typeNamePattern)
Meta
getSuperTypes
in interface Meta
public Meta.MetaResultSet getSuperTables(Meta.ConnectionHandle ch, String catalog, Meta.Pat schemaPattern, Meta.Pat tableNamePattern)
Meta
getSuperTables
in interface Meta
public Meta.MetaResultSet getAttributes(Meta.ConnectionHandle ch, String catalog, Meta.Pat schemaPattern, Meta.Pat typeNamePattern, Meta.Pat attributeNamePattern)
Meta
getAttributes
in interface Meta
public Meta.MetaResultSet getClientInfoProperties(Meta.ConnectionHandle ch)
Meta
getClientInfoProperties
in interface Meta
public Meta.MetaResultSet getFunctions(Meta.ConnectionHandle ch, String catalog, Meta.Pat schemaPattern, Meta.Pat functionNamePattern)
Meta
getFunctions
in interface Meta
public Meta.MetaResultSet getFunctionColumns(Meta.ConnectionHandle ch, String catalog, Meta.Pat schemaPattern, Meta.Pat functionNamePattern, Meta.Pat columnNamePattern)
Meta
getFunctionColumns
in interface Meta
public Meta.MetaResultSet getPseudoColumns(Meta.ConnectionHandle ch, String catalog, Meta.Pat schemaPattern, Meta.Pat tableNamePattern, Meta.Pat columnNamePattern)
Meta
getPseudoColumns
in interface Meta
public Iterable<Object> createIterable(Meta.StatementHandle handle, QueryState state, Meta.Signature signature, List<TypedValue> parameterValues, Meta.Frame firstFrame)
Meta
The default implementation just returns iterable
, which it
requires to be not null; derived classes may instead choose to execute the
relational expression in signature
.
createIterable
in interface Meta
public Meta.Frame fetch(AvaticaStatement stmt, List<TypedValue> parameterValues, long offset, int fetchMaxRowCount) throws NoSuchStatementException, MissingResultsException
public static boolean checkParameterValueHasNull(List<TypedValue> parameterValues)
Copyright © 2012-2024 Apache Software Foundation. All Rights Reserved.