[ 
https://issues.apache.org/jira/browse/OPENJPA-1797?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Richard Zowalla resolved OPENJPA-1797.
--------------------------------------
    Resolution: Won't Fix

Closing as obsolete during backlog cleanup: Same broken MappedSuperclass setup 
as 1796 (only the subclass's own columns appear in the INSERT); inherited-field 
persistence is TCK-covered on master and there is no reproducer anyone can act 
on. Please reopen if this still happens with OpenJPA 4.x.

> Can not persist subclass entity with its full data, if this subclass entity 
> has ManyToOne to another entity
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-1797
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1797
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: jpa
>    Affects Versions: 2.0.1
>            Reporter: Kai Feng Zhang
>            Priority: Major
>         Attachments: EmailDb.java, ListFieldDb.java, PersonDb.java
>
>
> A Person entity class, which has such emails field:
> @OneToMany(targetEntity = EmailDb.class, mappedBy = "person", cascade = 
> CascadeType.ALL)
>   protected List<ListField> emails = new ArrayList<ListField>();
> While Email entity is subclass of @MappedSuperclass ListFieldDb.
> Then I create email and add to person:
> EmailDb email = new EmailDb();
> email.setValue(targetAddress);
> email.setPrimary(false);
> email.setType("emailType");
> person.addEmail(emial);
> em.persist(person);
> But what I see from console about email table changes is: INSERT INTO email 
> (oid, person_id) VALUES (?, ?), and other data lost, especially the map key 
> 'person_id' to person table.
> Not sure if I am using something wrong? or this is a known issue?
> I pasted source code files for entity relationship reference. Thanks.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to