openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Fay Wang (JIRA)" <j...@apache.org>
Subject [jira] Commented: (OPENJPA-1061) Entities extending from a Mapped Superclass that defines the ID fields share the same ObjectID type parameter
Date Wed, 06 May 2009 16:23:30 GMT

    [ https://issues.apache.org/jira/browse/OPENJPA-1061?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12706488#action_12706488
] 

Fay Wang commented on OPENJPA-1061:
-----------------------------------

hi Jody, the patch looks fine to me. ClassMetaData.resolveMeta can potentially modify _embedded
field on the condition that the class meta data being resolved is actually "embedded" inside
some other entity/embeddable. In other words, it has "owner". In the MSC case, one can not
at the same time inherit from MSC and also embed an MSC when this MSC declares an Id field.
As to the method isEmbeddableOnly, the _embedded field will not be set again in this method
if it is already set. As you pointed out, in the case of MSC, this field is already set during
the annotation/xml parsing time.

> Entities extending from a Mapped Superclass that defines the ID fields share the same
ObjectID type parameter
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-1061
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1061
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: jpa
>    Affects Versions: 1.2.0, 1.2.1
>            Reporter: Jody Grassel
>            Assignee: Jody Grassel
>         Attachments: PCEnhancer.patch, unitttest.patch
>
>
> When a mapped superclass (MSC) defines @Id fields, it appears that entities extending
the MSC use the MSC's type in the generated ObjectID's type field.  This can result in unexpected
primary key collissions between entities that are not intended to be related in an entity
inheritance hierarchy.  Attached to the JIRA is a junit test case that demonstrates the problem.


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


Mime
View raw message