You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@openjpa.apache.org by garpinc <ga...@yahoo.com> on 2012/08/16 16:56:26 UTC
similar issue to https://issues.apache.org/jira/browse/OPENJPA-1607
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.
--
View this message in context: http://openjpa.208410.n2.nabble.com/similar-issue-to-https-issues-apache-org-jira-browse-OPENJPA-1607-tp7580889.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.
Re: similar issue to
https://issues.apache.org/jira/browse/OPENJPA-1607
Posted by garpinc <ga...@yahoo.com>.
Hey Rick you back from vacation? If so I have a few show stoppers i'd
appreciate your help with on Skype or otherwise..
--
View this message in context: http://openjpa.208410.n2.nabble.com/similar-issue-to-https-issues-apache-org-jira-browse-OPENJPA-1607-tp7580889p7581013.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.
Re: similar issue to
https://issues.apache.org/jira/browse/OPENJPA-1607
Posted by garpinc <ga...@yahoo.com>.
I installed a 2.0 persistence xml file but there was no difference in the
tables generated
--
View this message in context: http://openjpa.208410.n2.nabble.com/similar-issue-to-https-issues-apache-org-jira-browse-OPENJPA-1607-tp7580889p7580919.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.
Re: similar issue to https://issues.apache.org/jira/browse/OPENJPA-1607
Posted by Rick Curtis <cu...@gmail.com>.
Sorry, but I'm out on vacation for a couple weeks here. I'd suggest trying
to write a small test using a persistence.xml file... if it works as
expected when using a 2.0 p.xml, you'll need to figure out how to massage
your configuration to get the same behavior. Good luck!
Thanks,
Rick
On Thu, Aug 16, 2012 at 3:35 PM, garpinc <ga...@yahoo.com> wrote:
> Any ideas Rick?
>
>
>
> --
>
> --
*Rick Curtis*
Re: similar issue to
https://issues.apache.org/jira/browse/OPENJPA-1607
Posted by garpinc <ga...@yahoo.com>.
Any ideas Rick?
--
View this message in context: http://openjpa.208410.n2.nabble.com/similar-issue-to-https-issues-apache-org-jira-browse-OPENJPA-1607-tp7580889p7580892.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.
Re: similar issue to
https://issues.apache.org/jira/browse/OPENJPA-1607
Posted by garpinc <ga...@yahoo.com>.
I can't use a persistence.xml in my use case unfortunately because it's
dynamically produced.
Problem happens when creating schema. Here is the stack trace. Can u join
skype and see if you can see something i'm missing?
Caused by: org.apache.openjpa.persistence.ArgumentException: You have
supplied columns for
"com.cambridgesemantics.anzo.relationalreplicator.ontologies1.casting.DocumentCacheWrapper.documentOccursInThisCountry",
but this mapping cannot have columns in this context.
at
org.apache.openjpa.jdbc.meta.MappingInfo.assertNoSchemaComponents(MappingInfo.java:382)
~[openjpa-2.2.0patched.jar:2.2.0]
at
org.apache.openjpa.jdbc.meta.strats.RelationToManyTableFieldStrategy.map(RelationToManyTableFieldStrategy.java:97)
~[openjpa-2.2.0patched.jar:2.2.0]
at
org.apache.openjpa.jdbc.meta.strats.RelationCollectionTableFieldStrategy.map(RelationCollectionTableFieldStrategy.java:95)
~[openjpa-2.2.0patched.jar:2.2.0]
at
org.apache.openjpa.jdbc.meta.FieldMapping.setStrategy(FieldMapping.java:146)
~[openjpa-2.2.0patched.jar:2.2.0]
at
org.apache.openjpa.jdbc.meta.RuntimeStrategyInstaller.installStrategy(RuntimeStrategyInstaller.java:82)
~[openjpa-2.2.0patched.jar:2.2.0]
at
org.apache.openjpa.jdbc.meta.FieldMapping.resolveMapping(FieldMapping.java:496)
~[openjpa-2.2.0patched.jar:2.2.0]
at org.apache.openjpa.jdbc.meta.FieldMapping.resolve(FieldMapping.java:461)
~[openjpa-2.2.0patched.jar:2.2.0]
at
org.apache.openjpa.jdbc.meta.ClassMapping.resolveMapping(ClassMapping.java:854)
~[openjpa-2.2.0patched.jar:2.2.0]
at org.apache.openjpa.meta.ClassMetaData.resolve(ClassMetaData.java:1802)
~[openjpa-2.2.0patched.jar:2.2.0]
at
org.apache.openjpa.meta.MetaDataRepository.processBuffer(MetaDataRepository.java:822)
~[openjpa-2.2.0patched.jar:2.2.0]
at
org.apache.openjpa.meta.MetaDataRepository.resolveMapping(MetaDataRepository.java:777)
~[openjpa-2.2.0patched.jar:2.2.0]
at
org.apache.openjpa.meta.MetaDataRepository.resolve(MetaDataRepository.java:657)
~[openjpa-2.2.0patched.jar:2.2.0]
at
org.apache.openjpa.meta.MetaDataRepository.getMetaDataInternal(MetaDataRepository.java:411)
~[openjpa-2.2.0patched.jar:2.2.0]
at
org.apache.openjpa.meta.MetaDataRepository.getMetaData(MetaDataRepository.java:384)
~[openjpa-2.2.0patched.jar:2.2.0]
at
org.apache.openjpa.jdbc.meta.MappingRepository.getMapping(MappingRepository.java:355)
~[openjpa-2.2.0patched.jar:2.2.0]
at
org.apache.openjpa.jdbc.meta.MappingTool.getMapping(MappingTool.java:682)
~[openjpa-2.2.0patched.jar:2.2.0]
at
org.apache.openjpa.jdbc.meta.MappingTool.buildSchema(MappingTool.java:754)
~[openjpa-2.2.0patched.jar:2.2.0]
--
View this message in context: http://openjpa.208410.n2.nabble.com/similar-issue-to-https-issues-apache-org-jira-browse-OPENJPA-1607-tp7580889p7580891.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.
Re: similar issue to https://issues.apache.org/jira/browse/OPENJPA-1607
Posted by Rick Curtis <cu...@gmail.com>.
> 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 <ga...@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*