Skip to content

docs: annotate QueryModifiers and SchemaAndTable as @Immutable - #1900

Open
velo wants to merge 1 commit into
masterfrom
annotate-value-shaped-types-immutable
Open

docs: annotate QueryModifiers and SchemaAndTable as @Immutable#1900
velo wants to merge 1 commit into
masterfrom
annotate-value-shaped-types-immutable

Conversation

@velo

@velo velo commented Aug 19, 2026

Copy link
Copy Markdown
Member

Annotation only, no behaviour change.

@Immutable is RetentionPolicy.CLASS and marks the types in this codebase
that are already value-shaped: final fields only, value-based equals, no
identity dependence. PathMetadata, JoinExpression, JoinFlag,
OrderSpecifier, Template and its Element subclasses, ConstantImpl and
friends all carry it.

Two types that meet the same bar were missing it:

  • QueryModifiers — final class, two final fields, value equals/hashCode
  • SchemaAndTable — two final fields, value equals/hashCode

This keeps the annotated set an accurate inventory of the value-shaped types,
which is the list you would work from for any future value-class migration
(JEP 401), and it is useful documentation regardless.

Deliberately not included, since both are breaking changes and belong in their
own discussion:

  • marking these final — nothing in the repo extends either, but downstream
    code may
  • converting them to records — changes accessor names (getSchema()
    schema()) and the serialized form

Testing

./mvnw -Pdev -pl :querydsl-sql -am test: 3952 tests, 0 failures.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WnNBe1GoG2SxfU3FN7bcAA

Signed-off-by: Marvin Froeder <velo.br@gmail.com>
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