-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
more JPA @EmbbeddedId wrongly detected as surrogate #231
Comments
Hi Caleb, With a 3 week old baby in the house, I don't have a lot of spare time to work on EqualsVerifier... can you please give me something that I can copy-paste directly into my IDE and run without compiler issues, like the issue template asks? What do your class and equals method look like? |
kotlin generates equals/hashcode methods https://kotlinlang.org/docs/reference/data-classes.html
also congratulations |
Thanks. When you suppress Based on the discussion in #228 I decided to have EqualsVerifier handle |
the suppress works, the error given first mentions So this is the first time ever I've needed a compound key, or natural key with JPA. What I learned is if my @id doesn't have a @GeneratedValue it might not be a surrogate (e.g. if I had a |
It's very likely I didn't update all of the error messages when I added support for Broadly, EqualsVerifier recognises two situations:
Since your class only contains an id and nothing else, and this id is included in I agree with you that it's really a business/natural key, because RFID is a thing that exists in the world, but EqualsVerifier sadly can't smell what meaning a type has to humans. I prefer not to drag I prefer to open new issues instead of reverting to #255, so let's just stay here :). |
There's a third one I've never used mentioned in the objectdb documentation (linked above), |
Looks like |
I've released version 3.1.5, where the error messages should be better. |
version 3.1.4
my Id is an
@EmbeddedId
an example app https://www.callicoder.com/hibernate-spring-boot-jpa-composite-primary-key-example/
making this has made me think, maybe
@Id
shouldn't always be a surrogate, it's only with@GeneratedValue
according to.@EmbeddableId
doesn't extend@Id
though so why is it being detected as a surrogate.https://www.objectdb.com/java/jpa/entity/id
not sure if we should reopen #225
The text was updated successfully, but these errors were encountered: