[
http://opensource.atlassian.com/projects/hibernate/browse/HHH-4384?page=c...
]
Aleksei Valikov commented on HHH-4384:
--------------------------------------
I'm running into the same issue with JPA 2.
My environment:
JPA 2, Hibernate-3.5.1-Final, HSQLDB (the latter is not important).
I've created and attached a test case. If I uncomment @JoinColumn in
D.e/(a)AssociationOverride.joinColumns, I start getting errors.
{code}
@Embedded
@AssociationOverride(name = "f", joinColumns = { @JoinColumn(name =
"E_F") })
public E getE() { ... }
{code}
Here's a sample stacktrace:
{code}
javax.persistence.PersistenceException: [PersistenceUnit:
org.jvnet.hyperjaxb3.hibernate.tests.hhh4384] Unable to configure EntityManagerFactory
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:371)
at
org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:55)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:48)
at
org.jvnet.hyperjaxb3.hibernate.tests.hhh4384.EntityManagerFactoryTest.entityManagerFactoryCreated(EntityManagerFactoryTest.java:21)
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:597)
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.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
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)
Caused by: org.hibernate.AnnotationException: Illegal attempt to define a @JoinColumn with
a mappedBy association: e.f
at org.hibernate.cfg.Ejb3JoinColumn.buildJoinColumn(Ejb3JoinColumn.java:254)
at
org.hibernate.cfg.Ejb3JoinColumn.buildJoinColumnsWithDefaultColumnSuffix(Ejb3JoinColumn.java:227)
at org.hibernate.cfg.Ejb3JoinColumn.buildJoinColumns(Ejb3JoinColumn.java:196)
at org.hibernate.cfg.ColumnsBuilder.extractMetadata(ColumnsBuilder.java:94)
at
org.hibernate.cfg.AnnotationBinder.processElementAnnotations(AnnotationBinder.java:1415)
at org.hibernate.cfg.AnnotationBinder.fillComponent(AnnotationBinder.java:2333)
at org.hibernate.cfg.AnnotationBinder.fillComponent(AnnotationBinder.java:2240)
at org.hibernate.cfg.AnnotationBinder.bindComponent(AnnotationBinder.java:2192)
at
org.hibernate.cfg.AnnotationBinder.processElementAnnotations(AnnotationBinder.java:1939)
at
org.hibernate.cfg.AnnotationBinder.processIdPropertiesIfNotAlready(AnnotationBinder.java:762)
at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:726)
at
org.hibernate.cfg.AnnotationConfiguration.processArtifactsOfType(AnnotationConfiguration.java:636)
at
org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:359)
at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1206)
at org.hibernate.ejb.Ejb3Configuration.buildMappings(Ejb3Configuration.java:1449)
at
org.hibernate.ejb.EventListenerConfigurator.configure(EventListenerConfigurator.java:193)
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:1077)
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:275)
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:359)
... 25 more
{code}
@JoinColumn must be set for @AssociationOverride to work
--------------------------------------------------------
Key: HHH-4384
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-4384
Project: Hibernate Core
Issue Type: Improvement
Components: annotations
Environment: Hibernate 3.2 , MySQL
Reporter: Steve Ebersole
Priority: Minor
The following error is given when overiding the joincolumn which has not been set
explicitly:
Illegal attempt to define a @JoinColumn with a mappedBy association
see
http://forum.hibernate.org/viewtopic.php?t=960621&highlight=
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira