Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:
3.0.5
Mapping documents:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping
>
<class
name="org.borneo.model.Posting.PostingIdentification"
table="PostingIdentification"
>
<cache usage="transactional" />
<id
name="id"
type="java.lang.Long"
unsaved-value="none"
>
<column
name="ID"
/>
<generator class="assigned">
<!--
To add non XDoclet generator parameters, create a file named
hibernate-generator-params-PostingIdentification.xml
containing the additional parameters and place it in your merge dir.
-->
</generator>
</id>
<discriminator
column="discriminator"
/>
<version
name="version"
column="version"
type="java.lang.Integer"
/>
<component
name="address"
class="org.borneo.model.Address"
>
<property
name="address"
type="java.lang.String"
update="true"
insert="true"
column="ADDRESS"
not-null="false"
/>
<property
name="city"
type="java.lang.String"
update="true"
insert="true"
column="CITY"
length="50"
not-null="true"
/>
<many-to-one
name="country"
class="org.borneo.model.Country"
cascade="none"
outer-join="auto"
update="true"
insert="true"
column="FK_COUNTRY_ID"
not-null="true"
/>
<many-to-one
name="province"
class="org.borneo.model.Province"
cascade="none"
outer-join="auto"
update="true"
insert="true"
column="FK_PROVINCE_ID"
not-null="true"
/>
<property
name="postalCode"
type="java.lang.String"
update="true"
insert="true"
column="POSTALCODE"
length="10"
not-null="true"
/>
</component>
<list
name="contact"
lazy="false"
inverse="true"
cascade="save-update"
>
<key
column="POST_ID"
>
</key>
<index
column="contact_index"
/>
<one-to-many
class="org.borneo.model.Contact"
/>
</list>
<list
name="postingImages"
lazy="false"
inverse="true"
cascade="save-update"
>
<key
column="POST_ID"
>
</key>
<index
column="postingimages_index"
/>
<one-to-many
class="org.borneo.model.Posting.PostingImages"
/>
</list>
<set
name="categorizedItems"
lazy="true"
inverse="true"
cascade="all-delete-orphan"
sort="unsorted"
>
<key
foreign-key="FK2_CATEGORIZED_ITEM_ID"
>
<column
name="POST_ID"
length="16"
not-null="true"
/>
</key>
<one-to-many
class="org.borneo.model.Posting.CategorizedItem"
/>
</set>
<many-to-one
name="status"
class="org.borneo.model.Status"
cascade="save-update"
outer-join="auto"
update="true"
insert="true"
column="FK_STATUS_ID"
/>
<many-to-one
name="duration"
class="org.borneo.model.Posting.CategorizedType"
cascade="all"
outer-join="auto"
update="true"
insert="true"
column="FK_DURATION_ID"
not-null="false"
/>
<!--
To add non XDoclet property mappings, create a file named
hibernate-properties-PostingIdentification.xml
containing the additional properties and place it in your merge dir.
-->
<subclass
name="org.borneo.model.Posting.ResidentialProperties"
>
<component
name="propertiesComponent1"
class="org.borneo.model.Posting.PropertiesComponent1"
>
<property
name="feature1"
type="boolean"
update="true"
insert="true"
column="FEATURE1"
/>
<many-to-one
name="furnish"
class="org.borneo.model.Posting.Furnish"
cascade="none"
outer-join="auto"
update="true"
insert="true"
>
<column
name="FK_FURNISH_ID"
/>
</many-to-one>
<many-to-one
name="unitType"
class="org.borneo.model.Posting.UnitType"
cascade="none"
outer-join="auto"
update="true"
insert="true"
>
<column
name="FK_UNIT_TYPE_ID"
/>
</many-to-one>
</component>
<component
name="propertiesComponent2"
class="org.borneo.model.Posting.PropertiesComponent2"
>
<property
name="facility1"
type="boolean"
update="true"
insert="true"
column="FACILITY1"
/>
</component>
<many-to-one
name="rentalType"
class="org.borneo.model.Posting.RentalType"
cascade="save-update"
outer-join="auto"
update="true"
insert="true"
column="FK_RENTAL_TYPE_ID"
not-null="true"
/>
<many-to-one
name="districtType"
class="org.borneo.model.Posting.DistrictType"
cascade="save-update"
outer-join="auto"
update="true"
insert="true"
column="FK_DISTRICT_TYPE_ID"
not-null="true"
/>
<!--
To add non XDoclet property mappings, create a file named
hibernate-properties-ResidentialProperties.xml
containing the additional properties and place it in your merge dir.
-->
</subclass>
</class>
<query name="PostingDetail"><![CDATA[
from PostingIdentification pid where pid.id = ?
]]></query>
</hibernate-mapping>
Full stack trace of any exception that occurs:
[junit] Testcase: testUpdatePosting(org.borneo.dao.PostingDAOTest): Caused an ERROR
[junit] could not deserialize; nested exception is org.hibernate.type.SerializationException: could not deserialize
[junit] org.springframework.orm.hibernate3.HibernateSystemException: could not deserialize; nested exception is org.
hibernate.type.SerializationException: could not deserialize
[junit] org.hibernate.type.SerializationException: could not deserialize
[junit] at org.hibernate.util.SerializationHelper.deserialize(SerializationHelper.java:211)
[junit] at org.hibernate.util.SerializationHelper.deserialize(SerializationHelper.java:234)
[junit] at org.hibernate.type.SerializableType.fromBytes(SerializableType.java:78)
[junit] at org.hibernate.type.SerializableType.get(SerializableType.java:39)
[junit] at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:77)
[junit] at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:68)
[junit] at org.hibernate.type.AbstractType.hydrate(AbstractType.java:80)
[junit] at org.hibernate.persister.entity.BasicEntityPersister.hydrate(BasicEntityPersister.java:1690)
[junit] at org.hibernate.loader.Loader.loadFromResultSet(Loader.java:991)
[junit] at org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:942)
[junit] at org.hibernate.loader.Loader.getRow(Loader.java:855)
[junit] at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:305)
[junit] at org.hibernate.loader.Loader.doQuery(Loader.java:412)
[junit] at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:218)
[junit] at org.hibernate.loader.Loader.doList(Loader.java:1593)
[junit] at org.hibernate.loader.Loader.list(Loader.java:1577)
[junit] at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:395)
[junit] at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:271)
[junit] at org.hibernate.impl.SessionImpl.list(SessionImpl.java:844)
[junit] at org.hibernate.impl.QueryImpl.list(QueryImpl.java:74)
[junit] at org.springframework.orm.hibernate3.HibernateTemplate$32.doInHibernate(HibernateTemplate.java:815)
[junit] at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:312)
[junit] at org.springframework.orm.hibernate3.HibernateTemplate.findByNamedQuery(HibernateTemplate.java:806)
[junit] at org.springframework.orm.hibernate3.HibernateTemplate.findByNamedQuery(HibernateTemplate.java:802)
[junit] at org.borneo.dao.hibernate.PostingDAOHibernate.getPostingDetail(PostingDAOHibernate.java:48)
[junit] at org.borneo.dao.PostingDAOTest.testUpdatePosting(PostingDAOTest.java:185)
[junit] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[junit] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[junit] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[junit] Caused by: java.io.EOFException
[junit] at java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2232)
[junit] at java.io.ObjectInputStream$BlockDataInputStream.readUTFBody(ObjectInputStream.java:2967)
[junit] at java.io.ObjectInputStream$BlockDataInputStream.readUTF(ObjectInputStream.java:2768)
[junit] at java.io.ObjectInputStream.readUTF(ObjectInputStream.java:1021)
[junit] at java.io.ObjectStreamClass.readNonProxy(ObjectStreamClass.java:606)
[junit] at java.io.ObjectInputStream.readClassDescriptor(ObjectInputStream.java:778)
[junit] at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1528)
[junit] at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1460)
[junit] at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1693)
[junit] at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
[junit] at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1912)
[junit] at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1836)
[junit] at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1713)
[junit] at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
[junit] at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
[junit] at org.hibernate.util.SerializationHelper.deserialize(SerializationHelper.java:204)
[junit] ... 40 more
Name and version of the database you are using:
MySql 4.1.12
Hi guys,
I am runing into this stupid problem. Pls help, Thanks !
regards,
Prettyhandling