openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Oliver Ringel (JIRA)" <>
Subject [jira] Commented: (OPENJPA-1556) Exception thrown on first use of @Strategy in @Embeddable classes
Date Thu, 11 Mar 2010 14:35:27 GMT


Oliver Ringel commented on OPENJPA-1556:

the same exception occurs if you add the @Strategy annotation on a field of an @Embeddable
or @MappedSuperclass (not part of an @ElementCollection). 
The attached patch does not fix the problem. 

To be more concrete. I try to change the default enum handling using an own EnumValueHandler.
The Handler is working if you add
the Strategy to the @Entity. Adding the field to a @MappedSuperclass leads to the above exception.

@javax.persistence.Table(name = "TESTENTITY")
public class TestEntity extends TestEntityBase {

public abstract class TestEntityBase {
    @Column(name = "TESTENUMSIMPLE")
    private TestEnumSimple testEnumSimple;

You get the same Exception if you add the @Strategy to a @Embeddable and I also tried a own
StringValueHandler with the same result.

> Exception thrown on first use of @Strategy in @Embeddable classes
> -----------------------------------------------------------------
>                 Key: OPENJPA-1556
>                 URL:
>             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
>            Assignee: Fay Wang
>             Fix For: 2.0.0
>         Attachments: OPENJPA-1556.patch,
> 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(
> 	at org.apache.openjpa.jdbc.meta.MappingInfo.createColumns(
> 	at org.apache.openjpa.jdbc.meta.ValueMappingInfo.getColumns(
> 	at
> 	at
> 	at org.apache.openjpa.jdbc.meta.FieldMapping.setStrategy(
> 	... 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 <>
and <>, 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.

View raw message