Skip to content

fix(ksp): keep well-known QueryDSL Path type for @Convert/@Type/@JdbcTypeCode properties#1848

Open
goekhantopcu wants to merge 2 commits into
OpenFeign:masterfrom
goekhantopcu:local/ksp-fix-7.4.0
Open

fix(ksp): keep well-known QueryDSL Path type for @Convert/@Type/@JdbcTypeCode properties#1848
goekhantopcu wants to merge 2 commits into
OpenFeign:masterfrom
goekhantopcu:local/ksp-fix-7.4.0

Conversation

@goekhantopcu

@goekhantopcu goekhantopcu commented Jul 12, 2026

Copy link
Copy Markdown

Problem

In querydsl-ksp-codegen's TypeExtractor, properties annotated with @Convert, @Type, or @JdbcTypeCode are treated as "unknown" types and fall back to a generic SimplePath, even when the underlying Kotlin type (e.g. Instant, Boolean, LocalDate, ...) already has a well-known QueryDSL Path mapping.

@Convert (and friends) only change how JPA persists the attribute to the database column - the JPQL/Path-level type is still whatever the Kotlin property declares. Falling back to SimplePath needlessly throws away query capabilities such as DateTimePath.after()/before(), BooleanPath, NumberPath, etc. - capabilities that querydsl-apt (the Java APT generator) keeps for the very same case.

This is the same root cause as the existing enum check (#1410), just generalized to all of SimpleType.Mapper instead of only enums.

Fix

Skip the "unknown type" fallback in TypeExtractor when the type already has a well-known mapping in SimpleType.Mapper, so the generated Q-class keeps the specific Path type instead of degrading to SimplePath.

Testing

Added an integration test covering a @Convert-annotated Instant property, verifying the generated Q-class uses DateTimePath<Instant> instead of SimplePath<Instant>.

…ll-known types

Same fix as fix/ksp-convert-well-known-types-simplepath, applied
directly on top of the 7.4.0 release tag (not master) so every other
artifact stays byte-for-byte identical to the published 7.4.0 release
- only querydsl-ksp-codegen differs, by this one guard clause.

This is a local-only patch for mavenLocal() installation under the
unmodified '7.4.0' GAV coordinates, to use as a drop-in replacement
while https://github.com/OpenFeign/querydsl PR for
fix/ksp-convert-well-known-types-simplepath is pending review.
@goekhantopcu goekhantopcu changed the title local: patch querydsl-ksp-codegen SimplePath fallback for @Convert well-known types fix(ksp): keep well-known QueryDSL Path type for @Convert/@Type/@JdbcTypeCode properties Jul 12, 2026
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