You can implement any method in an abstract class ...
# spring
h
You can implement any method in an abstract class ¯\_(ツ)_/¯
z
Yes but why without
equals
and
hashCode
a default constructor was not created?
h
Now I'm confused – does a constructor have anything to do with
equals
and
hashCode
?
z
I don't think so, but it worked. We had an older service with this setup and the only thing I didn't copied from the AbstractEntity was the implementetion for
equals
and
hashCode
, because I thought they were useless since all my entities are gonna be data classes anyway
I tried just because I didn't know what else to try, and it worked
c
I'd really like to know what's going on there... Seems ridiculous.
a
I dont use entities, but a quick search did not reveal anything about needing to implement those methods. Are you sure you didn't actually just miss a default constructor before and added it while you added those methods?
z
Yes I'm sure
e
Andrea, I’ve noticed before that adding the noarg plugin (or the spring plugin) doesn’t necessarily regenerate your classes in your IDE. By you adding equals and hashcode, you told your IDE to recompile the class, so you got your noarg constructor through that.
👍 1
I would guess that you can remove the equals and hashcode now, and it’ll work 🙂