openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From atilla <>
Subject Embed on Secondary Table
Date Mon, 25 Aug 2008 19:12:22 GMT

I have two Tables CUSTOMER and CUSTOMER_EXT (mapped as Secondary)

@Entity@Table(name = "CUSTOMER")
@SecondaryTable(name = "CUSTOMER_EXT", pkJoinColumns =
@PrimaryKeyJoinColumn(name = "CUST_ID", referencedColumnName = "CUST_ID"))

I have COLUMNS FROM_DT, TO_DT in CUSTOMER_EXT and I am using a class
DateRange which maps those columns.

I am trying to embed this class and persist in the Secondary Table. 

//Customer.class embeds DateRange.class
@AttributeOverrides( {
@AttributeOverride(name = "from", column = @Column(name = "FROM_DT", table =
@AttributeOverride(name = "to", column = @Column(name = "TO_DT", table =
private DateRange dr;

When I do this it tries to insert into a column named DATERANGE_CUST_ID in
CUSTOMER_EXT which obviously is not there.
Any Clues? 
View this message in context:
Sent from the OpenJPA Users mailing list archive at

View raw message