So the parents class code would look like this:
| @Entity
| @Table(name = "ALL_IN_ONE_TABLE")
| @Inheritance(strategy = InheritanceType.SINGLE_TABLE)
| @DiscriminatorColumn(
| name = "CHILD_TYPE",
| discriminatorType = DiscriminatorType.INTEGER
| )
| public class ParentClass {
|
| @Id @GeneratedValue
| private long id;
| //common shared member for all children
| }
|
while the childrens code look like this:
| @Entity
| @DiscriminatorValue("1")
| public class FirstChildren extends Parent {
|
| //children specific member
|
| }
|
Note that the given discriminator value is a string.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4120983#4120983
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4120983
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user