Skip to content
Jin Kwon edited this page Jun 29, 2026 · 2 revisions

Model Notes

MetadataType

All bound result classes implement MetadataType, which extends Serializable.

Map<String, Object> unknownColumns = value.getUnknownColumns();

getUnknownColumns() records result-set columns returned by a JDBC driver that do not have a mapped field in the model class. This is useful because drivers sometimes expose vendor-specific metadata columns or differ across versions.

Binding Behavior

Context binds rows by:

  • reading the result-set column labels;
  • finding fields annotated with the internal _ColumnLabel annotation;
  • assigning result values by label;
  • storing unmapped result-set columns in MetadataType.getUnknownColumns().

Mapped fields are exposed through typed getters such as Table.getTableName(), Column.getDataType(), and PrimaryKey.getKeySeq().

Nullness

The package is annotated with JSpecify @NullMarked, and nullable JDBC values are explicitly marked in source with @Nullable.

Practical implications:

  • catalog and schema values may be null;
  • optional remarks, default values, generated-column flags, and driver-dependent metadata may be null;
  • JDBC integer and boolean values are exposed as wrapper types where a database or driver may report SQL NULL.

Relationships

The source contains internal relationship annotations that document how metadata records relate to each other.

Parent Children
Catalog Schema, Table, TablePrivilege, Procedure, SuperTable, SuperType
Schema Table, TablePrivilege, Procedure, SuperTable, SuperType
Table Column, ColumnPrivilege, PrimaryKey, ImportedKey, ExportedKey, CrossReference, IndexInfo, TablePrivilege, BestRowIdentifier, VersionColumn, PseudoColumn
Column ColumnPrivilege
Procedure ProcedureColumn
Function FunctionColumn
UDT Attribute, SuperType

Some result types are root-like and not children of another metadata type, including Catalog, TableType, and TypeInfo.

Ordering

Most JDBC metadata methods define an expected order for their result sets. Context preserves the order returned by the JDBC driver. Some model classes also contain comparator helpers for ordering records in the specification's expected order when driver behavior needs to be checked or normalized.

Known driver ordering and duplicate issues are tracked from the repository README:

  • MariaDB: table ordering, function ordering, and client-info property ordering issues are linked.
  • MySQL: duplicate table rows from DatabaseMetaData#getTables are linked.
  • PostgreSQL: duplicate function-column rows are linked.
  • SQL Server: procedure ordering issue is linked.

Scope Of The Library

The library does not create schemas, introspect SQL text, or normalize database products into a single metadata dialect. It keeps JDBC metadata visible as typed Java records while preserving JDBC driver behavior.

Clone this wiki locally