-
Notifications
You must be signed in to change notification settings - Fork 9
API Reference
Jin Kwon edited this page Jun 29, 2026
·
2 revisions
Context is the public facade over java.sql.DatabaseMetaData.
Context context = Context.newInstance(connection);
Context context = new Context(connection.getMetaData());Every metadata result-set method returns a List<T> of bound records. The binding layer maps JDBC result-set column labels to fields annotated in the corresponding model class.
Context method |
Delegates to DatabaseMetaData
|
Returns |
|---|---|---|
getAttributes(catalog, schemaPattern, typeNamePattern, attributeNamePattern) |
getAttributes |
List<Attribute> |
getBestRowIdentifier(catalog, schema, table, scope, nullable) |
getBestRowIdentifier |
List<BestRowIdentifier> |
getCatalogs() |
getCatalogs |
List<Catalog> |
getClientInfoProperties() |
getClientInfoProperties |
List<ClientInfoProperty> |
getColumnPrivileges(catalog, schema, table, columnNamePattern) |
getColumnPrivileges |
List<ColumnPrivilege> |
getColumns(catalog, schemaPattern, tableNamePattern, columnNamePattern) |
getColumns |
List<Column> |
getCrossReference(parentCatalog, parentSchema, parentTable, foreignCatalog, foreignSchema, foreignTable) |
getCrossReference |
List<CrossReference> |
getExportedKeys(catalog, schema, table) |
getExportedKeys |
List<ExportedKey> |
getFunctions(catalog, schemaPattern, functionNamePattern) |
getFunctions |
List<Function> |
getFunctionColumns(catalog, schemaPattern, functionNamePattern, columnNamePattern) |
getFunctionColumns |
List<FunctionColumn> |
getImportedKeys(catalog, schema, table) |
getImportedKeys |
List<ImportedKey> |
getIndexInfo(catalog, schema, table, unique, approximate) |
getIndexInfo |
List<IndexInfo> |
getPrimaryKeys(catalog, schema, table) |
getPrimaryKeys |
List<PrimaryKey> |
getProcedureColumns(catalog, schemaPattern, procedureNamePattern, columnNamePattern) |
getProcedureColumns |
List<ProcedureColumn> |
getProcedures(catalog, schemaPattern, procedureNamePattern) |
getProcedures |
List<Procedure> |
getPseudoColumns(catalog, schemaPattern, tableNamePattern, columnNamePattern) |
getPseudoColumns |
List<PseudoColumn> |
getSchemas() |
getSchemas |
List<Schema> |
getSchemas(catalog, schemaPattern) |
getSchemas |
List<Schema> |
getSuperTables(catalog, schemaPattern, tableNamePattern) |
getSuperTables |
List<SuperTable> |
getSuperTypes(catalog, schemaPattern, typeNamePattern) |
getSuperTypes |
List<SuperType> |
getTablePrivileges(catalog, schemaPattern, tableNamePattern) |
getTablePrivileges |
List<TablePrivilege> |
getTableTypes() |
getTableTypes |
List<TableType> |
getTables(catalog, schemaPattern, tableNamePattern, types) |
getTables |
List<Table> |
getTypeInfo() |
getTypeInfo |
List<TypeInfo> |
getUDTs(catalog, schemaPattern, typeNamePattern, types) |
getUDTs |
List<UDT> |
getVersionColumns(catalog, schema, table) |
getVersionColumns |
List<VersionColumn> |
These methods split comma-separated metadata strings into List<String> values.
Context method |
Delegates to DatabaseMetaData
|
|---|---|
getNumericFunctions() |
getNumericFunctions |
getSQLKeywords() |
getSQLKeywords |
getStringFunctions() |
getStringFunctions |
getSystemFunctions() |
getSystemFunctions |
getTimeDateFunctions() |
getTimeDateFunctions |
| Type | Represents |
|---|---|
Catalog |
Rows from getCatalogs()
|
Schema |
Rows from getSchemas()
|
Table |
Rows from getTables(...)
|
Column |
Rows from getColumns(...)
|
PrimaryKey |
Rows from getPrimaryKeys(...)
|
ImportedKey |
Rows from getImportedKeys(...)
|
ExportedKey |
Rows from getExportedKeys(...)
|
CrossReference |
Rows from getCrossReference(...)
|
IndexInfo |
Rows from getIndexInfo(...)
|
TablePrivilege |
Rows from getTablePrivileges(...)
|
ColumnPrivilege |
Rows from getColumnPrivileges(...)
|
Procedure |
Rows from getProcedures(...)
|
ProcedureColumn |
Rows from getProcedureColumns(...)
|
Function |
Rows from getFunctions(...)
|
FunctionColumn |
Rows from getFunctionColumns(...)
|
TypeInfo |
Rows from getTypeInfo()
|
UDT |
Rows from getUDTs(...)
|
Attribute |
Rows from getAttributes(...)
|
SuperType |
Rows from getSuperTypes(...)
|
SuperTable |
Rows from getSuperTables(...)
|
BestRowIdentifier |
Rows from getBestRowIdentifier(...)
|
VersionColumn |
Rows from getVersionColumns(...)
|
PseudoColumn |
Rows from getPseudoColumns(...)
|
ClientInfoProperty |
Rows from getClientInfoProperties()
|
TableType |
Rows from getTableTypes()
|
var context = Context.newInstance(connection);
for (var table : context.getTables(null, null, "%", null)) {
var catalog = table.getTableCat();
var schema = table.getTableSchem();
var name = table.getTableName();
var columns = context.getColumns(catalog, schema, name, "%");
var primaryKeys = context.getPrimaryKeys(catalog, schema, name);
var importedKeys = context.getImportedKeys(catalog, schema, name);
var indexes = context.getIndexInfo(catalog, schema, name, false, false);
}