Cant seem to get it working, can anyone give me some direction?
this is my mapping file so far:
Code:
<hibernate-mapping
>
<class
name="co.za.ep.CDS2.bus.Delivery"
table="delivery_tbl"
dynamic-update="false"
dynamic-insert="false"
select-before-update="false"
optimistic-lock="version"
>
<id type="int">
<generator class="foreign">
<param name="property">order</param>
</generator>
</id>
<bag
name="order"
lazy="false"
inverse="false"
cascade="none"
>
<key
column="delivery_id"
>
</key>
<one-to-many
class="co.za.ep.CDS2.bus.Order"
/>
</bag>
<!--
To add non XDoclet property mappings, create a file named
hibernate-properties-Customer.xml
containing the additional properties and place it in your merge dir.
-->
</class>
</hibernate-mapping>
And this is the error I get:
Code:
net.sf.hibernate.PropertyAccessException: exception setting property value with CGLIB setter of co.za.ep.CDS2.bus.Delivery.?
at net.sf.hibernate.persister.AbstractEntityPersister.setPropertyValues(AbstractEntityPersister.java:163)
at net.sf.hibernate.impl.SessionImpl.initializeEntity(SessionImpl.java:1964)
at net.sf.hibernate.loader.Loader.doFind(Loader.java:196)
at net.sf.hibernate.loader.Loader.find(Loader.java:604)
at net.sf.hibernate.hql.QueryTranslator.find(QueryTranslator.java:912)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1356)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1335)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1327)
at co.za.ep.CDS2.bus.GetTest.main(GetTest.java:39)
Caused by: java.lang.ClassCastException
at co.za.ep.CDS2.bus.DeliveryMetaClass0.setPropertyValues(<generated>)
at net.sf.hibernate.persister.AbstractEntityPersister.setPropertyValues(AbstractEntityPersister.java:158)
... 8 more
Exception in thread "main"