Beginner |
|
Joined: Thu Jul 28, 2005 6:40 pm Posts: 29
|
If I have the <joined-subclass...> shown below I get:
Exception in thread "main" org.hibernate.PropertyAccessException: could not get a field value by reflection getter of net.windward.store.demo.DemoRequest.demoRequestId
If I comment out the <joined-subclass...> lines, then it runs fine. Any idea what this means?
hbm.xml:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping default-access="field">
<class name="net.windward.store.demo.DemoRequest">
<id name="demoRequestId" type="int">
<generator class="native"/>
</id>
<property name="whereHeard" type="string"/>
<joined-subclass name="net.windward.store.util.Person">
<key column="demoRequestId"/>
<property name="name" type="string"/>
</joined-subclass>
</class>
</hibernate-mapping>
Full exception stack:
Exception in thread "main" org.hibernate.PropertyAccessException: could not get a field value by reflection getter of net.windward.store.demo.DemoRequest.demoRequestId
at org.hibernate.property.DirectPropertyAccessor$DirectGetter.get(DirectPropertyAccessor.java:34)
at org.hibernate.engine.UnsavedValueFactory.getUnsavedIdentifierValue(UnsavedValueFactory.java:44)
at org.hibernate.tuple.PropertyFactory.buildIdentifierProperty(PropertyFactory.java:42)
at org.hibernate.tuple.EntityMetamodel.<init>(EntityMetamodel.java:108)
at org.hibernate.persister.entity.BasicEntityPersister.<init>(BasicEntityPersister.java:400)
at org.hibernate.persister.entity.JoinedSubclassEntityPersister.<init>(JoinedSubclassEntityPersister.java:87)
at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:58)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:211)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1005)
at net.windward.store.demo.test.TestAll.main(TestAll.java:23)
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 com.intellij.rt.execution.application.AppMain.main(AppMain.java:78)
Caused by: java.lang.IllegalArgumentException
at sun.reflect.UnsafeFieldAccessorImpl.ensureObj(UnsafeFieldAccessorImpl.java:37)
at sun.reflect.UnsafeIntegerFieldAccessorImpl.getInt(UnsafeIntegerFieldAccessorImpl.java:38)
at sun.reflect.UnsafeIntegerFieldAccessorImpl.get(UnsafeIntegerFieldAccessorImpl.java:18)
at java.lang.reflect.Field.get(Field.java:357)
at org.hibernate.property.DirectPropertyAccessor$DirectGetter.get(DirectPropertyAccessor.java:31)
... 14 more
|
|