Hi,
This is about @Embedded annotation.
I have an object defined as follows
Object A contains Object B.
Object B contains Object C
A,B and C are defined in different tables.
Thse are my annotated beans
// Bean A
@Entity
@Table( name="A" )
@SecondaryTable( {
@SecondaryTable( name="B",pkJoinColumns=@PrimaryKeyJoinColumn( name="FK_ID_OfA" ) ),
@SecondaryTable( name="C",pkJoinColumns=@PrimaryKeyJoinColumn( name="FK_ID_OfA" ) )
} )
class A{
@Embedded
public B getB(){
}
}
// Bean B
@SecondaryTable( name="B" )
@Embeddable
class B {
@Embedded
public C getC(){
}
}
// Bean C
@SecondaryTable( name="C" )
@Embeddable
class C {
}
When I run this with Hibernate EM provider, it expects the properties defined in C to be contained within the table B.
Can anyone help me what annotations I am missing out.
Thanks
karthik
|