I have 2 Object A and B, which have same attributes, but different table.
@Entity
@Table(name = "A")
public class A {
@Id
private Integer id;
...
}
and
@Entity
@Table(name = "B")
public class B {
@Id
private Integer id;
...
}
it will cause duplicate code because every attributes are same. What is best practice to do this kind of problem?