I am new to annotations and would like to know if its possible to mix annotations with mappings while using inheritance strategies.
For (e.g) if I have a hbm mapping file say A.hbm.xml
Can I extend A and annotate it?
Specifically, can I do something like this:
@Entity
@Table(name="B")
@PrimaryKeyJoinColumn(name=B_id")
public class B extends A
{
@Column(name="newCol", nullable=true, length=50)
private String newCol;
...
}
class A does not have any annotations, just A.hbm
A.hbm:
<class name="com.my.object.A" >
...
<property name="name" column="name" ...>
</class>
Generally can I do something like this for any mapping strategy?
I read this line in the annotations docs and did not quiet understand:
"You cannot mix configuration strategies (hbm vs annotations) in a mapped entity hierarchy either"
Does this mean I cannot do what I am wanting to do?
|