projectlombok / lombok

Very spicy additions to the Java programming language.
https://projectlombok.org/
Other
12.84k stars 2.38k forks source link

JPA Composite keys annotated with @Date don't have equals() and hashCode() methods #184

Closed lombokissues closed 9 years ago

lombokissues commented 9 years ago

Migrated from Google Code (issue 111)

lombokissues commented 9 years ago

:bust_in_silhouette: wilder.rodrigues   :clock8: Mar 24, 2010 at 09:12 UTC

I have two JPA composite keys on my project. On Eclipse outline panel, I can see the equals() and hashCode() methods.

However, when I deploy my application on JBoss 5.0 EAP (that's the .com version, nor the community version), I got the following warns on my console.

10:02:48,713 WARN [RootClass] composite-id class does not override equals(): com.globalcollect.au.model.LitleRequestRecordPK 10:02:48,713 WARN [RootClass] composite-id class does not override hashCode(): com.globalcollect.au.model.LitleRequestRecordPK 10:02:48,713 WARN [RootClass] composite-id class does not override equals(): com.globalcollect.au.model.OrderRequestPK 10:02:48,713 WARN [RootClass] composite-id class does not override hashCode(): com.globalcollect.au.model.OrderRequestPK.

That's the snippet of my composite keys:

@ Data @ Embeddable public class LitleRequestRecordPK implements Serializable { ... }

@ Data @ Embeddable public class OrderRequestPK implements Serializable { ... }

What steps will reproduce the problem? 1. 2. 3.

Versions:

lombokissues commented 9 years ago

:bust_in_silhouette: wilder.rodrigues   :clock8: Mar 24, 2010 at 13:04 UTC

I'm using Eclipse Galileo on Windows XP Professional.

lombokissues commented 9 years ago

:bust_in_silhouette: reinierz   :clock8: Mar 26, 2010 at 00:39 UTC

Can't reproduce; probably because you didn't include full snippets. For what its worth, sticking "@ Embeddable" on a class makes not one iota of difference to lombok, at least right now, which means this boils down to: "@ Data doesn't work". Presumably then lombok.jar isn't on the classpath when this code is being compiled.

lombokissues commented 9 years ago

End of migration