Hello community!
I've got interesting troubles with inheritance. The type of inheritance is JOINED.
Hibernate version:
3.2.4 SP1
Name and version of the database you are using:
Ingres 9.0.4
Here is the description of my troubles. I've got different TodoList entries which inherit a baseclass.
The base class looks like:
Code:
@Entity
@org.hibernate.annotations.Entity(dynamicUpdate = true)
@Inheritance(strategy = InheritanceType.JOINED)
@Table(name = "uptoip_todo", schema = "ingres", uniqueConstraints = {})
public class UptoipTodo implements java.io.Serializable
{
[...]
The child classes look like:
1. TodoProject
Code:
@Entity
@org.hibernate.annotations.Entity(dynamicUpdate = true)
@Table(name = "uptoip_todo_project", schema = "ingres")
public class UptoipTodoProject extends UptoipTodo
{
[...]
2. TodoIpRight
Code:
@Entity
@org.hibernate.annotations.Entity(dynamicUpdate = true)
@Table(name = "uptoip_todo_ip_right", schema = "ingres")
public class UptoipTodoIpRight extends UptoipTodo
{
[...]
Apparently there is no difference between the child classes. Only the member variables are different. I guess this should not have any consequences.
With this query I trie to load the different TodoList entries.
Code:
em.createQuery("FROM UptoipTodo u WHERE u.resolveUser is null");
The test data is available for every TodoList entry (baseclass and child-class). The query delivers results for each query.
BUT: If the TodoList entry is from type TodoProject Hibernate can't deliver enough information. It is not able to distinguish between TodoProject and UptoipTodo. It delivers only UptoipTodo classes although it is definitively from type UptoipProject. I guess Hibernate loses the inheritance information on the way.
Finally: Hibernate is able to deliver the inheritance-structure (base-class and child-class) not in all ways. Once it works and sometimes it does not work.
I hope that there is anyone who could give me some hints to solve the problem.
Best regards,
Alex