[
http://opensource.atlassian.com/projects/hibernate/browse/ANN-763?page=co...
]
Arne Limburg commented on ANN-763:
----------------------------------
May it be, that the feature I expected, is simply not supported by Hibernate? In this case
you should consider to throw a more meaningful exception.
Hibernate fails on startup when using IdClass and one of the
id-properties is an embedded object.
-------------------------------------------------------------------------------------------------
Key: ANN-763
URL:
http://opensource.atlassian.com/projects/hibernate/browse/ANN-763
Project: Hibernate Annotations
Issue Type: Bug
Affects Versions: 3.3.1.GA, 3.4.0.CR1, 3.4.0.CR2
Environment: Hibernate 3.2.6 with HSQLDB, tested with Hibernate-Annotations
3.3.1.GA and 3.4.0.CR2
Reporter: Arne Limburg
Attachments: OrderLinePk.java, Product.java
To verify this I modified the entities for the CompositeIdTest:
I changed the Product class to be embeddable (by annotating it with @Embeddable instead
of @Entity and annotating the property with @Basic instead of @Id) and the Reference in
the OrderLinePK class from @ManyToOne @JoinColumn to @Embedded.
This resulted in the following exception:
org.hibernate.PropertyNotFoundException: field [name] not found on
org.hibernate.test.annotations.cid.OrderLine
at
org.hibernate.property.DirectPropertyAccessor.getField(DirectPropertyAccessor.java:122)
at
org.hibernate.property.DirectPropertyAccessor.getField(DirectPropertyAccessor.java:114)
at
org.hibernate.property.DirectPropertyAccessor.getGetter(DirectPropertyAccessor.java:137)
at org.hibernate.mapping.Property.getGetter(Property.java:272)
at
org.hibernate.tuple.component.PojoComponentTuplizer.buildGetter(PojoComponentTuplizer.java:133)
at
org.hibernate.tuple.component.AbstractComponentTuplizer.<init>(AbstractComponentTuplizer.java:43)
at
org.hibernate.tuple.component.PojoComponentTuplizer.<init>(PojoComponentTuplizer.java:38)
at
org.hibernate.tuple.component.ComponentEntityModeToTuplizerMapping.<init>(ComponentEntityModeToTuplizerMapping.java:52)
at
org.hibernate.tuple.component.ComponentMetamodel.<init>(ComponentMetamodel.java:50)
at org.hibernate.mapping.Component.buildType(Component.java:152)
at org.hibernate.mapping.Component.getType(Component.java:145)
at org.hibernate.tuple.PropertyFactory.buildStandardProperty(PropertyFactory.java:120)
at
org.hibernate.tuple.component.ComponentMetamodel.<init>(ComponentMetamodel.java:45)
at org.hibernate.mapping.Component.buildType(Component.java:152)
at org.hibernate.mapping.Component.getType(Component.java:145)
at org.hibernate.mapping.SimpleValue.isValid(SimpleValue.java:253)
at org.hibernate.mapping.Property.isValid(Property.java:185)
at org.hibernate.mapping.PersistentClass.validate(PersistentClass.java:440)
at org.hibernate.mapping.RootClass.validate(RootClass.java:192)
at org.hibernate.cfg.Configuration.validate(Configuration.java:1108)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1293)
at
org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:915)
at org.hibernate.test.annotations.TestCase.buildSessionFactory(TestCase.java:51)
at org.hibernate.test.annotations.TestCase.setUp(TestCase.java:61)
at junit.framework.TestCase.runBare(TestCase.java:125)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at
org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
--
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