Class MetaImpl
- All Implemented Interfaces:
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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic @interfaceAnnotation that indicates that a meta field may not contain null values.static @interfaceAnnotation that indicates that a meta field may contain null values.static @interfaceAnnotation that indicates that it is unknown whether a meta field may contain null values.static classMetadata describing an attribute.static classMetadata describing the best identifier for a row.static classMetadata describing a catalog.static classMetadata describing a client info property.static classMetadata describing a column.static classMetadata describing a column privilege.static classMetadata describing a cross reference.static classMetadata describing an exported key.static classMetadata describing a function.static classMetadata describing a function column.static classMetadata describing an imported key.static classMetadata describing index info.static classMetadata describing a primary key.static classMetadata describing a procedure.static classMetadata describing a procedure column.static classMetadata describing a pseudo column.static classMetadata describing a schema.static classMetadata describing a super-table.static classMetadata describing a super-type.static classMetadata describing a table.static classMetadata describing a table privilege.static classMetadata describing a table type.static classMetadata describing type info.static classMetadata describing a user-defined type.static classMetadata describing a version column.static interfaceAn object that has a name.Nested classes/interfaces inherited from interface org.apache.calcite.avatica.Meta
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 -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final AvaticaConnectionTheAvaticaConnectionbackingthis.protected final ConnectionPropertiesImplRepresents the various states specific toconnection. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleancheckParameterValueHasNull(List<TypedValue> parameterValues) Returns whether a list of parameter values has any null elements.voidCloses a connectionstatic ColumnMetaDatacolumnMetaData(String name, int index, Class<?> type, boolean columnNullable) static ColumnMetaDatacolumnMetaData(String name, int index, Class<?> type, int columnNullable) static ColumnMetaDatacolumnMetaData(String name, int index, ColumnMetaData.AvaticaType type, boolean columnNullable) static ColumnMetaDatacolumnMetaData(String name, int index, ColumnMetaData.AvaticaType type, int columnNullable) connectionSync(Meta.ConnectionHandle ch, Meta.ConnectionProperties connProps) Synchronizes client and server view of connection properties.static CursorcreateCursor(Meta.CursorFactory cursorFactory, Iterable<Object> iterable) protected <E> Meta.MetaResultSetcreateEmptyResultSet(Class<E> clazz) Creates an empty result set.createIterable(Meta.StatementHandle handle, QueryState state, Meta.Signature signature, List<TypedValue> parameterValues, Meta.Frame firstFrame) Creates an iterable for a result set.protected Meta.MetaResultSetcreateResultSet(Map<String, Object> internalParameters, List<ColumnMetaData> columns, Meta.CursorFactory cursorFactory, Meta.Frame firstFrame) Called during the creation of a statement to allocate a new handle.fetch(AvaticaStatement stmt, List<TypedValue> parameterValues, long offset, int fetchMaxRowCount) protected static ColumnMetaData.StructTypefieldMetaData(Class<?> clazz) getAttributes(Meta.ConnectionHandle ch, String catalog, Meta.Pat schemaPattern, Meta.Pat typeNamePattern, Meta.Pat attributeNamePattern) getBestRowIdentifier(Meta.ConnectionHandle ch, String catalog, String schema, String table, int scope, boolean nullable) protected static intgetColumnNullability(Field field) getColumnPrivileges(Meta.ConnectionHandle ch, String catalog, String schema, String table, Meta.Pat columnNamePattern) getColumns(Meta.ConnectionHandle ch, String catalog, Meta.Pat schemaPattern, Meta.Pat tableNamePattern, Meta.Pat columnNamePattern) getCrossReference(Meta.ConnectionHandle ch, String parentCatalog, String parentSchema, String parentTable, String foreignCatalog, String foreignSchema, String foreignTable) Returns a map of static database properties.getExportedKeys(Meta.ConnectionHandle ch, String catalog, String schema, String table) getFunctionColumns(Meta.ConnectionHandle ch, String catalog, Meta.Pat schemaPattern, Meta.Pat functionNamePattern, Meta.Pat columnNamePattern) getFunctions(Meta.ConnectionHandle ch, String catalog, Meta.Pat schemaPattern, Meta.Pat functionNamePattern) getImportedKeys(Meta.ConnectionHandle ch, String catalog, String schema, String table) getIndexInfo(Meta.ConnectionHandle ch, String catalog, String schema, String table, boolean unique, boolean approximate) getPrimaryKeys(Meta.ConnectionHandle ch, String catalog, String schema, String table) getProcedureColumns(Meta.ConnectionHandle ch, String catalog, Meta.Pat schemaPattern, Meta.Pat procedureNamePattern, Meta.Pat columnNamePattern) getProcedures(Meta.ConnectionHandle ch, String catalog, Meta.Pat schemaPattern, Meta.Pat procedureNamePattern) getPseudoColumns(Meta.ConnectionHandle ch, String catalog, Meta.Pat schemaPattern, Meta.Pat tableNamePattern, Meta.Pat columnNamePattern) getSchemas(Meta.ConnectionHandle ch, String catalog, Meta.Pat schemaPattern) getSuperTables(Meta.ConnectionHandle ch, String catalog, Meta.Pat schemaPattern, Meta.Pat tableNamePattern) getSuperTypes(Meta.ConnectionHandle ch, String catalog, Meta.Pat schemaPattern, Meta.Pat typeNamePattern) getTablePrivileges(Meta.ConnectionHandle ch, String catalog, Meta.Pat schemaPattern, Meta.Pat tableNamePattern) getTables(Meta.ConnectionHandle ch, String catalog, Meta.Pat schemaPattern, Meta.Pat tableNamePattern, List<String> typeList) getUDTs(Meta.ConnectionHandle ch, String catalog, Meta.Pat schemaPattern, Meta.Pat typeNamePattern, int[] types) getVersionColumns(Meta.ConnectionHandle ch, String catalog, String schema, String table) voidopenConnection(Meta.ConnectionHandle ch, Map<String, String> info) Opens (creates) a connection.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.calcite.avatica.Meta
closeStatement, commit, execute, execute, executeBatch, fetch, prepare, prepareAndExecute, prepareAndExecute, prepareAndExecuteBatch, rollback, syncResults
-
Field Details
-
connection
TheAvaticaConnectionbackingthis. -
connProps
Represents the various states specific toconnection.Note: this instance is used recursively with
connection's getter and setter methods.
-
-
Constructor Details
-
MetaImpl
-
-
Method Details
-
createCursor
-
collect
-
collect
-
openConnection
Description copied from interface:MetaOpens (creates) a connection. The client allocates its own connection ID which the server is then made aware of through theMeta.ConnectionHandle. The Mapinfoargument is analogous to thePropertiestypically passed to a "normal" JDBC Driver. Avatica specific properties should not be included -- only properties for the underlying driver.- Specified by:
openConnectionin interfaceMeta- Parameters:
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.
-
closeConnection
Description copied from interface:MetaCloses a connection- Specified by:
closeConnectionin interfaceMeta
-
connectionSync
public Meta.ConnectionProperties connectionSync(Meta.ConnectionHandle ch, Meta.ConnectionProperties connProps) Description copied from interface:MetaSynchronizes client and server view of connection properties.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, andResultSet.- Specified by:
connectionSyncin interfaceMeta
-
createStatement
Description copied from interface:MetaCalled during the creation of a statement to allocate a new handle.- Specified by:
createStatementin interfaceMeta- Parameters:
ch- Connection handle
-
createEmptyResultSet
Creates an empty result set. Useful for JDBC metadata methods that are not implemented or which query entities that are not supported (e.g. triggers in Lingual). -
columnMetaData
public static ColumnMetaData columnMetaData(String name, int index, Class<?> type, boolean columnNullable) -
columnMetaData
public static ColumnMetaData columnMetaData(String name, int index, ColumnMetaData.AvaticaType type, boolean columnNullable) -
columnMetaData
public static ColumnMetaData columnMetaData(String name, int index, Class<?> type, int columnNullable) -
columnMetaData
public static ColumnMetaData columnMetaData(String name, int index, ColumnMetaData.AvaticaType type, int columnNullable) -
fieldMetaData
-
getColumnNullability
-
createResultSet
protected Meta.MetaResultSet createResultSet(Map<String, Object> internalParameters, List<ColumnMetaData> columns, Meta.CursorFactory cursorFactory, Meta.Frame firstFrame) -
getDatabaseProperties
Description copied from interface:MetaReturns a map of static database properties.The provider can omit properties whose value is the same as the default.
- Specified by:
getDatabasePropertiesin interfaceMeta
-
getTables
public Meta.MetaResultSet getTables(Meta.ConnectionHandle ch, String catalog, Meta.Pat schemaPattern, Meta.Pat tableNamePattern, List<String> typeList) Description copied from interface:Meta -
getColumns
public Meta.MetaResultSet getColumns(Meta.ConnectionHandle ch, String catalog, Meta.Pat schemaPattern, Meta.Pat tableNamePattern, Meta.Pat columnNamePattern) Description copied from interface:Meta- Specified by:
getColumnsin interfaceMeta
-
getSchemas
public Meta.MetaResultSet getSchemas(Meta.ConnectionHandle ch, String catalog, Meta.Pat schemaPattern) - Specified by:
getSchemasin interfaceMeta
-
getCatalogs
Description copied from interface:Meta- Specified by:
getCatalogsin interfaceMeta
-
getTableTypes
Description copied from interface:Meta- Specified by:
getTableTypesin interfaceMeta
-
getProcedures
public Meta.MetaResultSet getProcedures(Meta.ConnectionHandle ch, String catalog, Meta.Pat schemaPattern, Meta.Pat procedureNamePattern) Description copied from interface:Meta- Specified by:
getProceduresin interfaceMeta
-
getProcedureColumns
public Meta.MetaResultSet getProcedureColumns(Meta.ConnectionHandle ch, String catalog, Meta.Pat schemaPattern, Meta.Pat procedureNamePattern, Meta.Pat columnNamePattern) Description copied from interface:Meta- Specified by:
getProcedureColumnsin interfaceMeta
-
getColumnPrivileges
public Meta.MetaResultSet getColumnPrivileges(Meta.ConnectionHandle ch, String catalog, String schema, String table, Meta.Pat columnNamePattern) Description copied from interface:Meta- Specified by:
getColumnPrivilegesin interfaceMeta
-
getTablePrivileges
public Meta.MetaResultSet getTablePrivileges(Meta.ConnectionHandle ch, String catalog, Meta.Pat schemaPattern, Meta.Pat tableNamePattern) Description copied from interface:Meta- Specified by:
getTablePrivilegesin interfaceMeta
-
getBestRowIdentifier
public Meta.MetaResultSet getBestRowIdentifier(Meta.ConnectionHandle ch, String catalog, String schema, String table, int scope, boolean nullable) Description copied from interface:Meta- Specified by:
getBestRowIdentifierin interfaceMeta
-
getVersionColumns
public Meta.MetaResultSet getVersionColumns(Meta.ConnectionHandle ch, String catalog, String schema, String table) Description copied from interface:Meta- Specified by:
getVersionColumnsin interfaceMeta
-
getPrimaryKeys
public Meta.MetaResultSet getPrimaryKeys(Meta.ConnectionHandle ch, String catalog, String schema, String table) Description copied from interface:Meta- Specified by:
getPrimaryKeysin interfaceMeta
-
getImportedKeys
public Meta.MetaResultSet getImportedKeys(Meta.ConnectionHandle ch, String catalog, String schema, String table) Description copied from interface:Meta- Specified by:
getImportedKeysin interfaceMeta
-
getExportedKeys
public Meta.MetaResultSet getExportedKeys(Meta.ConnectionHandle ch, String catalog, String schema, String table) Description copied from interface:Meta- Specified by:
getExportedKeysin interfaceMeta
-
getCrossReference
public Meta.MetaResultSet getCrossReference(Meta.ConnectionHandle ch, String parentCatalog, String parentSchema, String parentTable, String foreignCatalog, String foreignSchema, String foreignTable) Description copied from interface:Meta- Specified by:
getCrossReferencein interfaceMeta
-
getTypeInfo
Description copied from interface:Meta- Specified by:
getTypeInfoin interfaceMeta
-
getIndexInfo
public Meta.MetaResultSet getIndexInfo(Meta.ConnectionHandle ch, String catalog, String schema, String table, boolean unique, boolean approximate) Description copied from interface:Meta- Specified by:
getIndexInfoin interfaceMeta
-
getUDTs
public Meta.MetaResultSet getUDTs(Meta.ConnectionHandle ch, String catalog, Meta.Pat schemaPattern, Meta.Pat typeNamePattern, int[] types) Description copied from interface:Meta -
getSuperTypes
public Meta.MetaResultSet getSuperTypes(Meta.ConnectionHandle ch, String catalog, Meta.Pat schemaPattern, Meta.Pat typeNamePattern) Description copied from interface:Meta- Specified by:
getSuperTypesin interfaceMeta
-
getSuperTables
public Meta.MetaResultSet getSuperTables(Meta.ConnectionHandle ch, String catalog, Meta.Pat schemaPattern, Meta.Pat tableNamePattern) Description copied from interface:Meta- Specified by:
getSuperTablesin interfaceMeta
-
getAttributes
public Meta.MetaResultSet getAttributes(Meta.ConnectionHandle ch, String catalog, Meta.Pat schemaPattern, Meta.Pat typeNamePattern, Meta.Pat attributeNamePattern) Description copied from interface:Meta- Specified by:
getAttributesin interfaceMeta
-
getClientInfoProperties
Description copied from interface:Meta- Specified by:
getClientInfoPropertiesin interfaceMeta
-
getFunctions
public Meta.MetaResultSet getFunctions(Meta.ConnectionHandle ch, String catalog, Meta.Pat schemaPattern, Meta.Pat functionNamePattern) Description copied from interface:Meta- Specified by:
getFunctionsin interfaceMeta
-
getFunctionColumns
public Meta.MetaResultSet getFunctionColumns(Meta.ConnectionHandle ch, String catalog, Meta.Pat schemaPattern, Meta.Pat functionNamePattern, Meta.Pat columnNamePattern) Description copied from interface:Meta- Specified by:
getFunctionColumnsin interfaceMeta
-
getPseudoColumns
public Meta.MetaResultSet getPseudoColumns(Meta.ConnectionHandle ch, String catalog, Meta.Pat schemaPattern, Meta.Pat tableNamePattern, Meta.Pat columnNamePattern) Description copied from interface:Meta- Specified by:
getPseudoColumnsin interfaceMeta
-
createIterable
public Iterable<Object> createIterable(Meta.StatementHandle handle, QueryState state, Meta.Signature signature, List<TypedValue> parameterValues, Meta.Frame firstFrame) Description copied from interface:MetaCreates an iterable for a result set.The default implementation just returns
iterable, which it requires to be not null; derived classes may instead choose to execute the relational expression insignature.- Specified by:
createIterablein interfaceMeta
-
fetch
public Meta.Frame fetch(AvaticaStatement stmt, List<TypedValue> parameterValues, long offset, int fetchMaxRowCount) throws NoSuchStatementException, MissingResultsException -
checkParameterValueHasNull
Returns whether a list of parameter values has any null elements.
-