Hi all,
(I'm posting this here because I'm not sure if it's just annotation related or about a more general hierarchy mapping concern)
I have a hierarchy where class B extends class A. Both are entities:
Code:
@Entity
class A {
}
@Entity
class B extends A{
}
with the above annotations hibernate will try to map A and B as a SINGLE_TABLE hierarchy.Also, with TABLE_PER_CLASS it will forbid AUTO ids. But as I don't care to treat A and B polymorphically it would be fine for me to just map them as different classes, disregarding their inheritance relationship. Something like that could be achieved, although a bit laboriously, as:
Code:
@MappedSuperclass
abstract class X {
}
@Entity
class A extends X{
}
@Entity
class B extends X {
}
Is there any way to do the same thing avoiding this somewhat synthetic abstract class expedient.
Thank you in advance
Cheers,
Carlos