Skip to content

Deprecate Identifiable - #78

Merged
BalusC merged 1 commit into
developfrom
feature/75-deprecate-identifiable
Nov 3, 2026
Merged

BalusC merged 1 commit into
developfrom
feature/75-deprecate-identifiable

Conversation

@BalusC

@BalusC BalusC commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

Identifiable is now @Deprecated(since = "1.3", forRemoval = true). Entities need not implement it since #36 and #72: BaseEntityService and EntityRepository read the ID via the metamodel, and EntityRepository#getId(E) returns it.

Changes:

  • BaseEntity declares getId() and setId(I) itself. It still implements Identifiable until its removal, so its subclasses are not affected.
  • Page.ID ("id") is the new home of the alias for the ID attribute in criteria and ordering. Identifiable.ID refers to it until removal.
  • EntityMetadata and IdAttribute use the methods of BaseEntity instead of those of Identifiable. An entity which implements Identifiable without extending BaseEntity now gets its ID via the ID attribute, which gives the same value.
  • Provider#getIdentifier still accepts Identifiable until its removal. It cannot fall back to the ID attribute as proposed in the issue, because Provider has no access to the metamodel.

The build compiles with failOnWarning, so the remaining references to Identifiable have @SuppressWarnings("removal"). The Eclipse compiler reports these as unnecessary, but javac needs them.

OptimusFaces develop compiles against this with removal warnings only. omnifaces/optimusfaces#43 removes its references to Identifiable.

All tests pass on H2 with Hibernate, EclipseLink and OpenJPA.

Fixes #75

🤖 Generated with Claude Opus 5.5

Entities need not implement Identifiable since EntityRepository and
EntityRepository#getId(E). BaseEntity declares getId() and setId(I)
itself, and the "id" alias of the ID attribute moves to Page.ID.
EntityMetadata and IdAttribute use the methods of BaseEntity instead
of those of Identifiable. Provider#getIdentifier still accepts
Identifiable until its removal.

Fixes #75

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@BalusC
BalusC merged commit 7891286 into develop Nov 3, 2026
3 checks passed
@BalusC
BalusC deleted the feature/75-deprecate-identifiable branch November 3, 2026 14:15
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