org.hibernate.PropertyNotFoundException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • 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)
    via by Arne Limburg,
  • 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)
    via by Arne Limburg,
    • 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)

    Users with the same issue

    Unknown visitor2 times, last one,