You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "Pinaki Poddar (JIRA)" <ji...@apache.org> on 2008/08/26 00:01:46 UTC
[jira] Created: (OPENJPA-705) Embedded fields in Secondary table
generates wrong foreign key
Embedded fields in Secondary table generates wrong foreign key
--------------------------------------------------------------
Key: OPENJPA-705
URL: https://issues.apache.org/jira/browse/OPENJPA-705
Project: OpenJPA
Issue Type: Bug
Reporter: Pinaki Poddar
Assignee: Pinaki Poddar
Fix For: 1.3.0
When embedded entity is mapped to a secondary table, the primary key of the secondary table that refers to the owner table is named wrongly and different from the primaryKeyJoinColumn value specified in the @SecondaryTable annotation.
Originally reported in OpenJPA User forum [1] as the following example
@Entity
@Table(name = "CUSTOMER")
@SecondaryTable(name = "CUSTOMER_EXT",
pkJoinColumns = @PrimaryKeyJoinColumn(name = "CUST_ID", referencedColumnName = "CUST_ID"))
public class Customer {
@Embedded
@AttributeOverrides( {
@AttributeOverride(name = "from", column = @Column(name = "FROM_DT", table = "CUSTOMER_EXT")),
@AttributeOverride(name = "to", column = @Column(name = "TO_DT", table = "CUSTOMER_EXT"))} )
private DateRange dr;
The mapping should generate CUSTOMER_EXT table with 3 columns: CUST_ID, FROM_DT, TO_DT.
However, it generates a column named DATERANGE_CUST_ID instead of CUST_ID as specified in @SecondaryTable annotation.
[1] http://n2.nabble.com/Embed-on-Secondary-Table-tc782286.html
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (OPENJPA-705) Embedded fields in Secondary table
generates wrong foreign key
Posted by "Pinaki Poddar (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OPENJPA-705?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Pinaki Poddar resolved OPENJPA-705.
-----------------------------------
Resolution: Fixed
> Embedded fields in Secondary table generates wrong foreign key
> --------------------------------------------------------------
>
> Key: OPENJPA-705
> URL: https://issues.apache.org/jira/browse/OPENJPA-705
> Project: OpenJPA
> Issue Type: Bug
> Reporter: Pinaki Poddar
> Assignee: Pinaki Poddar
> Fix For: 1.3.0
>
>
> When embedded entity is mapped to a secondary table, the primary key of the secondary table that refers to the owner table is named wrongly and different from the primaryKeyJoinColumn value specified in the @SecondaryTable annotation.
> Originally reported in OpenJPA User forum [1] as the following example
> @Entity
> @Table(name = "CUSTOMER")
> @SecondaryTable(name = "CUSTOMER_EXT",
> pkJoinColumns = @PrimaryKeyJoinColumn(name = "CUST_ID", referencedColumnName = "CUST_ID"))
> public class Customer {
> @Embedded
> @AttributeOverrides( {
> @AttributeOverride(name = "from", column = @Column(name = "FROM_DT", table = "CUSTOMER_EXT")),
> @AttributeOverride(name = "to", column = @Column(name = "TO_DT", table = "CUSTOMER_EXT"))} )
> private DateRange dr;
> The mapping should generate CUSTOMER_EXT table with 3 columns: CUST_ID, FROM_DT, TO_DT.
> However, it generates a column named DATERANGE_CUST_ID instead of CUST_ID as specified in @SecondaryTable annotation.
> [1] http://n2.nabble.com/Embed-on-Secondary-Table-tc782286.html
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.