You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "Rick Curtis (JIRA)" <ji...@apache.org> on 2009/05/07 18:49:31 UTC

[jira] Created: (OPENJPA-1072) Nested embeddable with a relationship to an Entity with a generated id doesn't persist the relationship

Nested embeddable with a relationship to an Entity with a generated id doesn't persist the relationship
-------------------------------------------------------------------------------------------------------

                 Key: OPENJPA-1072
                 URL: https://issues.apache.org/jira/browse/OPENJPA-1072
             Project: OpenJPA
          Issue Type: Bug
          Components: jpa
    Affects Versions: 2.0.0
            Reporter: Rick Curtis
         Attachments: jpa.embeddables.zip

When working with embeddables I found that if I define a unidirectional @ManyToOne relationship from an embeddable to an Entity which has a generated id, the relationship in the join table doesn't get persisted. I'll attach a zip with my code, but I'll also try to describe the scenario here.

Entities: 
Seller - Has an auto generated ID and a name
Book - Has an id(isbn) and an ElementCollection of Listings
Listing - An embeddable that has a ManyToOne relationship to Seller, a price and comments.

The scenario is as follows:
* Create all the sellers.
* Create a book.
* Add a listing to each book. Each listing takes a Seller Entity and a price.
* When I commit the book, the seller_id column in my Listing join table is always zero.



-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (OPENJPA-1072) Nested embeddable with a relationship to an Entity with a generated id doesn't persist the relationship

Posted by "Fay Wang (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-1072?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Fay Wang reassigned OPENJPA-1072:
---------------------------------

    Assignee: Fay Wang

> Nested embeddable with a relationship to an Entity with a generated id doesn't persist the relationship
> -------------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-1072
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1072
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: jpa
>    Affects Versions: 2.0.0
>            Reporter: Rick Curtis
>            Assignee: Fay Wang
>         Attachments: jpa.embeddables.zip
>
>
> When working with embeddables I found that if I define a unidirectional @ManyToOne relationship from an embeddable to an Entity which has a generated id, the relationship in the join table doesn't get persisted. I'll attach a zip with my code, but I'll also try to describe the scenario here.
> Entities: 
> Seller - Has an auto generated ID and a name
> Book - Has an id(isbn) and an ElementCollection of Listings
> Listing - An embeddable that has a ManyToOne relationship to Seller, a price and comments.
> The scenario is as follows:
> * Create all the sellers.
> * Create a book.
> * Add a listing to each book. Each listing takes a Seller Entity and a price.
> * When I commit the book, the seller_id column in my Listing join table is always zero.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (OPENJPA-1072) Nested embeddable with a relationship to an Entity with a generated id doesn't persist the relationship

Posted by "Fay Wang (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-1072?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Fay Wang resolved OPENJPA-1072.
-------------------------------

       Resolution: Fixed
    Fix Version/s: 2.0.0

> Nested embeddable with a relationship to an Entity with a generated id doesn't persist the relationship
> -------------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-1072
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1072
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: jpa
>    Affects Versions: 2.0.0
>            Reporter: Rick Curtis
>            Assignee: Fay Wang
>             Fix For: 2.0.0
>
>         Attachments: jpa.embeddables.zip
>
>
> When working with embeddables I found that if I define a unidirectional @ManyToOne relationship from an embeddable to an Entity which has a generated id, the relationship in the join table doesn't get persisted. I'll attach a zip with my code, but I'll also try to describe the scenario here.
> Entities: 
> Seller - Has an auto generated ID and a name
> Book - Has an id(isbn) and an ElementCollection of Listings
> Listing - An embeddable that has a ManyToOne relationship to Seller, a price and comments.
> The scenario is as follows:
> * Create all the sellers.
> * Create a book.
> * Add a listing to each book. Each listing takes a Seller Entity and a price.
> * When I commit the book, the seller_id column in my Listing join table is always zero.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (OPENJPA-1072) Nested embeddable with a relationship to an Entity with a generated id doesn't persist the relationship

Posted by "Rick Curtis (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-1072?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rick Curtis updated OPENJPA-1072:
---------------------------------

    Attachment: jpa.embeddables.zip

Attaching recreate.

> Nested embeddable with a relationship to an Entity with a generated id doesn't persist the relationship
> -------------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-1072
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1072
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: jpa
>    Affects Versions: 2.0.0
>            Reporter: Rick Curtis
>         Attachments: jpa.embeddables.zip
>
>
> When working with embeddables I found that if I define a unidirectional @ManyToOne relationship from an embeddable to an Entity which has a generated id, the relationship in the join table doesn't get persisted. I'll attach a zip with my code, but I'll also try to describe the scenario here.
> Entities: 
> Seller - Has an auto generated ID and a name
> Book - Has an id(isbn) and an ElementCollection of Listings
> Listing - An embeddable that has a ManyToOne relationship to Seller, a price and comments.
> The scenario is as follows:
> * Create all the sellers.
> * Create a book.
> * Add a listing to each book. Each listing takes a Seller Entity and a price.
> * When I commit the book, the seller_id column in my Listing join table is always zero.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.