Hello! I do not know if this is possible but I have two database tables (lets call them "parent" and "children") that have the same structure except that one "children" table has an extra field.
Now I can have two classes (Parent.java and Children.java) mapped to each of these tables that will contain the same fields and setter/getter methods except that Children will contain a extra property along with its setter/getter method OR what I was looking into doing was having Children.java EXTEND Parent.java but have the mapping annotations in Children.java map to the "children" table instead of the "parent" table. Is this possible?
Here is what Parent annotations look like:
Code:
@Entity
@Where(clause = "deleted_at IS NULL")
@Table(name = "parent")
@XmlType(name = "Parent", namespace = "http://model.myproject.com")
public class Parent implements Auditable {
....
here is what Children annotations I was hoping would look like with with the mapping to a different DB
Code:
@Entity
@Where(clause = "deleted_at IS NULL")
@Table(name = "children")
@XmlType(name = "Children", namespace = "http://model.myproject.com")
public class Children extends Parent {
....
I tried this code but it doesn't work because it's still being mapped to "parent" table and its complains that the extra property in Children could not be mapped or found.
Thanks!