Repository navigation
Deprecate Identifiable - #78
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Identifiableis now@Deprecated(since = "1.3", forRemoval = true). Entities need not implement it since #36 and #72:BaseEntityServiceandEntityRepositoryread the ID via the metamodel, andEntityRepository#getId(E)returns it.Changes:
BaseEntitydeclaresgetId()andsetId(I)itself. It still implementsIdentifiableuntil 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.IDrefers to it until removal.EntityMetadataandIdAttributeuse the methods ofBaseEntityinstead of those ofIdentifiable. An entity which implementsIdentifiablewithout extendingBaseEntitynow gets its ID via the ID attribute, which gives the same value.Provider#getIdentifierstill acceptsIdentifiableuntil its removal. It cannot fall back to the ID attribute as proposed in the issue, becauseProviderhas no access to the metamodel.The build compiles with
failOnWarning, so the remaining references toIdentifiablehave@SuppressWarnings("removal"). The Eclipse compiler reports these as unnecessary, but javac needs them.OptimusFaces develop compiles against this with
removalwarnings only. omnifaces/optimusfaces#43 removes its references toIdentifiable.All tests pass on H2 with Hibernate, EclipseLink and OpenJPA.
Fixes #75
🤖 Generated with Claude Opus 5.5