openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Derya Altuntas (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (OPENJPA-1253) JoinColumn annotation not allowed in conjunction with *ToMany annotation
Date Tue, 19 Apr 2011 08:50:05 GMT

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

Derya Altuntas commented on OPENJPA-1253:
-----------------------------------------

I am using open JPA 2.1.0 .I am receiving same error
 <openjpa-2.1.0-r422266:1071316 fatal user error> org.apache.openjpa.persistence.ArgumentException:
You have supplied columns for "com.siemens.EntityBean.DBAccessManager.Role.authorizations",
but this mapping cannot have columns in this context.
	at org.apache.openjpa.jdbc.meta.MappingInfo.assertNoSchemaComponents(MappingInfo.java:382)
	at org.apache.openjpa.jdbc.meta.strats.RelationToManyInverseKeyFieldStrategy.map(RelationToManyInverseKeyFieldStrategy.java:120)
	at org.apache.openjpa.jdbc.meta.strats.RelationCollectionInverseKeyFieldStrategy.map(RelationCollectionInverseKeyFieldStrategy.java:95)
	at org.apache.openjpa.jdbc.meta.FieldMapping.setStrategy(FieldMapping.java:146)
	at org.apache.openjpa.jdbc.meta.RuntimeStrategyInstaller.installStrategy(RuntimeStrategyInstaller.java:82)
	at org.apache.openjpa.jdbc.meta.FieldMapping.resolveMapping(FieldMapping.java:496)
	at org.apache.openjpa.jdbc.meta.FieldMapping.resolve(FieldMapping.java:461)
	at org.apache.openjpa.jdbc.meta.ClassMapping.resolveMapping(ClassMapping.java:854)
	at org.apache.openjpa.meta.ClassMetaData.resolve(ClassMetaData.java:1801)
	at org.apache.openjpa.meta.MetaDataRepository.processBuffer(MetaDataRepository.java:822)
	at org.apache.openjpa.meta.MetaDataRepository.resolveMapping(MetaDataRepository.java:777)
	at org.apache.openjpa.meta.MetaDataRepository.resolve(MetaDataRepository.java:657)
	at org.apache.openjpa.meta.MetaDataRepository.getMetaDataInternal(MetaDataRepository.java:411)
	at org.apache.openjpa.meta.MetaDataRepository.getMetaData(MetaDataRepository.java:384)
	at org.apache.openjpa.enhance.PCEnhancer.<init>(PCEnhancer.java:283)
	at org.apache.openjpa.enhance.PCEnhancer.<init>(PCEnhancer.java:254)
	at org.apache.openjpa.enhance.PCEnhancer.<init>(PCEnhancer.java:222)
	at org.apache.openjpa.enhance.ManagedClassSubclasser.prepareUnenhancedClasses(ManagedClassSubclasser.java:134)
	at org.apache.openjpa.kernel.AbstractBrokerFactory.loadPersistentTypes(AbstractBrokerFactory.java:315)
	at org.apache.openjpa.kernel.AbstractBrokerFactory.initializeBroker(AbstractBrokerFactory.java:239)
	at org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:213)
	at org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:156)
	at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:227)
	at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:154)
	at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:60)
	at org.jboss.jpa.deployment.ManagedEntityManagerFactory.getNonTxEntityManager(ManagedEntityManagerFactory.java:72)
	at org.jboss.jpa.deployment.ManagedEntityManagerFactory.getTransactionScopedEntityManager(ManagedEntityManagerFactory.java:171)
	at org.jboss.jpa.deployment.PersistenceUnitDeployment.getTransactionScopedEntityManager(PersistenceUnitDeployment.java:178)
	at org.jboss.jpa.impl.tx.TransactionScopedEntityManager.getEntityManager(TransactionScopedEntityManager.java:262)
	at org.jboss.jpa.impl.tx.TransactionScopedEntityManager.find(TransactionScopedEntityManager.java:191)
	at com.siemens.EntityBean.DBAccessManager.UserService.find(UserService.java:22)
	at com.siemens.SessionBean.FileManager.FileManagerBean.printUsers(FileManagerBean.java:86)
	at com.siemens.SessionBean.FileManager.FileManagerBean.copyFile(FileManagerBean.java:43)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

> JoinColumn annotation not allowed in conjunction with *ToMany annotation
> ------------------------------------------------------------------------
>
>                 Key: OPENJPA-1253
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1253
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: jdbc
>    Affects Versions: 2.0.0-M1, 2.0.0-M2, 2.0.0-M3
>            Reporter: Rick Curtis
>            Assignee: Fay Wang
>             Fix For: 2.0.0-M3
>
>
> I receive the following exception if I have an Entity with a One(Many)ToMany relationship
with another Entity. 
> <openjpa-2.0.0-SNAPSHOT-r422266:805588 fatal user error> org.apache.openjpa.persistence.ArgumentException:
You have supplied columns for "....Entity", but this mapping cannot have columns in this context.
> To recreate the failure, add a @JoinColumn annotation to one of the *ToMany relationships
in org.apache.openjpa.persistence.jdbc.annotations.AnnoTest1. 
> example:
>     @MapKey(name = "basic")
>     @OneToMany(mappedBy = "oneManyOwner")
>     @JoinColumn(name = "asdf")
>     protected Map<String, AnnoTest2> inverseOwnerMapKey = new HashMap();
> Then run:
> trunk\openjpa-parent\openjpa-persistence-jdbc>mvn test -Dtest=org.apache.openjpa.persistence.jdbc.annotations.TestOneToMany

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message