>  I'm programmatically creating the persistence context
This might be part of your problem. Can you see if the problem goes away of
you use a persistence.xml file? Kevin indicated[1] that he needed to set
the persistence level on his xml to 2.0... perhaps you're missing something
when creating your context?

Thanks,
Rick

[1]

>>>>>>>>>>
Okay, I just reproduced it...

<openjpa-2.1.0-SNAPSHOT-r422266:1045352 fatal user error>
org.apache.openjpa.persistence.ArgumentException: You have supplied columns
for
"org.apache.openjpa.persistence.compat.EntityC_B1MJT.bi1mjt<element:class
java.lang.Object>", but this mapping cannot have columns in this context.

But, I had to change my persistence.xml to reference the 1.0 xsd instead of
the 2.0 xsd:

<persistence
    xmlns="http://java.sun.com/xml/ns/persistence";
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
    xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
        http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd";
    version="1.0" >

If I use the 2.0 xsd, then everything works as expected.

When I look at the original testcase posted, there were two persistence.xml
files in the package. One had 1.0, the other had 2.0. So, depending on
which one was referenced, it could cause the error.

Can you check which xsd is being utilized in your respective environments?

The reason for the difference is that the OneToMany with FK was not
supported in JPA 1.0. Thus, the check for the condition and the error
message. But, with JPA 2.0, this is FK is supported.

My take is that is working as designed, as long as the originators of the
JIRA can verify the proper xsd is being used.
>>>>>>>>>>

On Thu, Aug 16, 2012 at 9:56 AM, garpinc <garp...@yahoo.com> wrote:

> I'm programmatically creating the persistence context via
>
> Properties jpaConf = new Properties();
>         jpaConf.put("openjpa.Id", JPA_ID);
>
> Persistence.createEntityManagerFactory(JPAHelperFactory.getInstance().getPersistenceID(),
> jpaConf)
>
> with following annotation
>         @OneToMany(targetEntity=XXX.class)
>         @JoinColumn(name="XXX_fk")
>
> i'm getting error
> You have supplied columns for "XXX.yymethod", but this mapping cannot have
> columns in this context.
>
> I thought JoinColumn is supported with OneToMany in JPA 2.0 spec
>
> am I doing something wrong here?
>
> The issue seems similar to
> https://issues.apache.org/jira/browse/OPENJPA-1607 except that i'm not
> using
> a persistence.xml in this use case.
>
>
>
>
>
> --

-- 
*Rick Curtis*

Reply via email to