Skip to content

feat: map REAL, DOUBLE PRECISION, BYTEA, and TIME to Java types - #50

Merged
omer-cengel merged 2 commits into
masterfrom
feature/floating-point-binary-and-time-types
Sep 28, 2026
Merged

omer-cengel merged 2 commits into
masterfrom
feature/floating-point-binary-and-time-types

Conversation

@omer-cengel

Copy link
Copy Markdown
Member

Summary

Columns declared as REAL, DOUBLE PRECISION, BYTEA, or TIME previously had no Java mapping and failed any query that used them. They now generate Float, Double, byte[], and java.time.LocalTime for query parameters and result components, so everyday numeric, binary, and time-of-day columns can be read and written through generated repositories.

Changes

  • Map the spellings REAL and FLOAT4 to Float, DOUBLE PRECISION and FLOAT8 to Double, BYTEA to byte[], and TIME and TIME WITHOUT TIME ZONE to java.time.LocalTime, matched case-insensitively with type arguments such as TIME(3) ignored.
  • Import java.time.LocalTime in generated repositories and row records that use it; values are read with resultSet.getObject(position, Type.class) and bound unchanged, with no runtime change.
  • Add schema-parser tests for every spelling, generator type and import tests, a compiled generated-source test (including a query whose only parameter is byte[]), and a PostgreSQL round trip of non-null and null values through generated code.
  • Document the new mappings, the LocalTime import, and the unmapped spellings in the PostgreSQL guide.

Scope and non-goals

  • FLOAT and FLOAT(p), whose precision selects the type, and TIME WITH TIME ZONE/TIMETZ remain unmapped and are recorded as unsupported types.
  • Arrays of the new types, such as REAL[], remain unsupported; byte[] is the only generated array type.
  • Nullability never changes the generated type; primitive Java types are not used.
  • A record compares a byte[] component by reference, so two rows holding equal bytes are not equals.
  • JSON/JSONB, enums, and arrays are not part of this change.

@omer-cengel
omer-cengel merged commit a527e75 into master Sep 28, 2026
6 checks passed
@omer-cengel
omer-cengel deleted the feature/floating-point-binary-and-time-types branch September 28, 2026 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant