[
https://issues.apache.org/jira/browse/OPENJPA-1253?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12833089#action_12833089
]
Jimmy Isaac Ventura Salcedo commented on OPENJPA-1253:
------------------------------------------------------
Is there an equivalent fix for version 1.2.1? i have encountered the same issue
there.
Example:
public class BaseLog{
@OneToMany(fetch=EAGER)
@JoinColumn(name="PROVIDER_ID", referencedColumnName="CODIGOMICO")
private Set<RufteEnte> rufteEnte;
....
}
public class RufteEnte implements Serializable {
private static final long serialVersionUID = 1L;
@Id
private long id;
private String codigomico;
...
}
java.lang.AssertionError: Exception:<openjpa-1.2.1-r752877:753278 fatal user
error> org.apache.openjpa.persistence.ArgumentException: You have supplied
columns for "org.venture.jpa.BaseLog.rufteEnte", but this mapping cannot have
columns in this context.
at org.junit.Assert.fail(Assert.java:91)
at org.venture.jpa.TestBaseLogDAO.testGetBaseLog(TestBaseLogDAO.java:17)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at
org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:73)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:46)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:180)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:41)
at org.junit.runners.ParentRunner$1.evaluate(ParentRunner.java:173)
at
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at
org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
at org.junit.runners.ParentRunner.run(ParentRunner.java:220)
at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:46)
at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
> 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.
-
You can reply to this email to add a comment to the issue online.