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

Jerry Carter updated OPENJPA-1556:
----------------------------------

    Attachment: openjpa1556.tar.zip

The attached Eclipse project uses Maven for the builds.  Import into Eclipse 
and build as Maven install.  There will be an exception thrown from 
TestSimpleDAO::testCreateEntity().  Readding the commented lines as the start 
of the function will cause the exception to be caught and ignored on the first 
pass with all subsequent interactions succeeding.

> Exception thrown on first use of @Strategy in @Embeddable classes
> -----------------------------------------------------------------
>
>                 Key: OPENJPA-1556
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1556
>             Project: OpenJPA
>          Issue Type: Bug
>    Affects Versions: 2.0.0-beta2
>         Environment: Mac OS X 10.6, Maven 2.2.x, Spring 3.0
>            Reporter: Jerry Carter
>         Attachments: openjpa1556.tar.zip
>
>
> I have an entity (SimpleEntity) which references an ElementCollection 
> (ChildOne.class).  There is a @Strategy annotation on a field within the 
> embeddable class.  The first time a query is built for the entity, an 
> exception is thrown:
> <openjpa-2.0.0-beta2-r422266:915978 fatal user error> 
> org.apache.openjpa.persistence.ArgumentException: Attempt to map 
> "com.example.ChildOne.address" failed: the owning entity is not mapped.
>       at 
> org.apache.openjpa.jdbc.meta.MappingInfo.assertTable(MappingInfo.java:628)
>       at 
> org.apache.openjpa.jdbc.meta.MappingInfo.createColumns(MappingInfo.java:558)
>       at 
> org.apache.openjpa.jdbc.meta.ValueMappingInfo.getColumns(ValueMappingInfo.java:178)
>       at 
> org.apache.openjpa.jdbc.meta.strats.HandlerStrategies.map(HandlerStrategies.java:65)
>       at 
> org.apache.openjpa.jdbc.meta.strats.HandlerFieldStrategy.map(HandlerFieldStrategy.java:81)
>       at 
> org.apache.openjpa.jdbc.meta.FieldMapping.setStrategy(FieldMapping.java:146)
>       ... etc. ...
> If the @Strategy is not present, everything works fine.  If the exception is 
> intentionally triggered, subsequent use is successful.
> Google suggests that this behavior has been seen before 
> <http://marc.info/?l=geronimo-user&m=121545735018232&w=2> and 
> <http://issues.apache.org/jira/browse/OPENJPA-524>, though there appears to 
> have been no resolution in either case and this differs by use of 
> @ElementCollection.

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

Reply via email to