79177316

Date: 2024-11-11 10:44:46
Score: 1
Natty:
Report link

You Java entity should match your table structure in DB. So, it will be advisable to have all the property including id in your Entity classes FirstChild and SecondChild.

Now, maybe you want your code to use one instance of parent class to call the same set of setters. For this, you should inherit an interface with the list of common getter / setters and implement the same on both the classes. This way you can code to interface instead of the implementation.

Reasons:
  • No code block (0.5):
  • Low reputation (0.5):
Posted by: Anshuman