You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to use a record as @EmbeddedId id in an entity.
public record RecordEmbeddedId(Stringid, Stringid2) {
}
@EntitypublicclassRecordEmbeddedIdEntity {
@EmbeddedIdRecordEmbeddedIdid;
Stringname;
// setters and getters
}
When running the testing codes to verify the record support, I got the following errors.
Exception Description: Predeployment of PersistenceUnit [defaultPU] failed.
Internal Exception: Exception [EclipseLink-7246] (Eclipse Persistence Services - 5.0.0-B02.v202404111748): org.eclipse.persistence.exceptions.ValidationException
Exception Description: The Entity class [class com.example.RecordEmbeddedIdEntity] has an embedded attribute [id] of type [class com.example.RecordEmbeddedId] which is NOT an Embeddabl
e class. Probable reason: missing @Embeddable or missing <embeddable>in orm.xml if metadata-complete = true. Please see server.log for more details. [status: CLIENT_ERROR reason: Bad Request]
If I add @Embeddable to record like this.
@Embeddablepublic record RecordEmbeddedId(Stringid, Stringid2) {
}
Run the tests, it will throw the following exceptions.
Exception [EclipseLink-63] (Eclipse Persistence Services - 5.0.0-B02.v202404111748): org.eclipse.persistence.exceptions.DescriptorException
Exception Description: The instance creation method [com.example.RecordEmbeddedId.<Default Constructor>], with no parameters, does not exist, or is not accessible.
Internal Exception: java.lang.NoSuchMethodException: com.example.RecordEmbeddedId.<init>()
Descriptor: RelationalDescriptor(com.example.RecordEmbeddedId --> [DatabaseTable(RECORDEMBEDDEDIDENTITY)])
To Reproduce
Steps/resources to reproduce the behavior:
I tried to use a record as
@EmbeddedId
id in an entity.When running the testing codes to verify the record support, I got the following errors.
If I add
@Embeddable
to record like this.Run the tests, it will throw the following exceptions.
To Reproduce
Steps/resources to reproduce the behavior:
The text was updated successfully, but these errors were encountered: