Hey guys/girls... I am starting with spring boot a...
# spring
j
Hey guys/girls... I am starting with spring boot and kotlin... and I found some problems with hashcode when my entity class is a
data class
... is there any solution that does not involves implementing equals and hashcode by hand?
c
Hi, some problems - yes, some - no 🙂 Any specific problems?
j
As far as I could understand. When trying to access a list of entities ( data classes) through a relationship spring uses hashcode to do something and fails. I will post the stacktrace.
the juice parte in the stack above is between lines 32 and 37 ... It happens when I access http://localhost:8080/users/1/trainings ... meaning a User from a Team has Trainings in Sectors
If I remove the
data
from Training class the request works fine.
l
there is not full stack trace.
I think this is typical problem with back references, hashCode method call hashCode on fields and back reference call it again recursively
try to write it yourself without data class