Here is a problem I run into during Hibernate upgrading from 3.x to 4.1. I have entity classes in a single inheritance implemented with Hibernate Annotation 3.x package as the followings:
Code:
@MappedSuperclass
@Entity
@Table(name = "theTable")
public class Parent{
...
}
@Entity
@Table(name = "theTable")
public class Child extends Parent {
...
}
With the 4 version, the above needs to be modified as the followings:
Code:
@Entity
@Inheritance(strategy=InheritanceType.SINGLE_TABLE)
@Table(name = "theTable")
public class Parent{
...
}
@Entity
public class Child extends Parent {
...
}
Which is fine to me with one exception. All related queries will come with child0_.DTYPE='Child'.
Is a way to get rid of the default Discriminator Column or I have to add the column to my tables without any practice useability but just to meet the requirement?