I am unable to retrieve/load object
Item it1 = (Item) session.load(Item.class,new Long(1));
throws
HibernateException Could not deserialize a serializable property:
but
u2 = (Users) session.load(Users.class,new Long(4));
is working properly.
I am using Hibernate 2.0.3
The mappings are as follows :
/********************************* Item.hbm ********************/
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping>
<class
name="org.hibernate.workshop.toolset.Item"
dynamic-update="false"
dynamic-insert="false"
>
<id
name="itemId"
column="itemId"
type="java.lang.Long"
>
<generator class="assigned">
</generator>
</id>
<property
name="name"
type="java.lang.String"
update="true"
insert="true"
column="Name"
/>
<property
name="description"
type="java.lang.String"
update="true"
insert="true"
column="description"
/>
<property
name="initialPrice"
type="java.lang.Float"
update="true"
insert="true"
column="initial_Price"
/>
<property
name="reservePrice"
type="java.lang.Float"
update="true"
insert="true"
column="reserve_Price"
/>
<property
name="startDatetime"
type="java.util.Date"
update="true"
insert="true"
column="start_Datetime"
/>
<property
name="endDatetime"
type="java.util.Date"
update="true"
insert="true"
column="end_Datetime"
/>
<property
name="lastUpdated"
type="java.util.Date"
update="true"
insert="true"
column="last_Updated"
/>
<property
name="seller"
type="org.hibernate.workshop.toolset.Users"
update="true"
insert="true"
column="seller_Id"
/>
<many-to-one
name="successfulBid"
class="org.hibernate.workshop.toolset.Bid"
cascade="none"
outer-join="auto"
update="true"
insert="true"
column="successful_Bid_id"
/>
<set
name="bids"
lazy="true"
inverse="true"
cascade="all"
sort="unsorted"
>
<key
column="item"
/>
<one-to-many
class="org.hibernate.workshop.toolset.Bid"
/>
</set>
<!--
To add non XDoclet property mappings, create a file named
hibernate-properties-Item.xml
containing the additional properties and place it in your merge
dir.
-->
</class>
</hibernate-mapping>
/********************************** Users.hbm **********////
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping>
<class
name="org.hibernate.workshop.toolset.Users"
dynamic-update="false"
dynamic-insert="false"
>
<id
name="userId"
column="userId"
type="java.lang.Long"
>
<generator class="assigned">
</generator>
</id>
<property
name="handle"
type="java.lang.String"
update="true"
insert="true"
column="handle"
/>
<property
name="name"
type="java.lang.String"
update="true"
insert="true"
column="name"
/>
<property
name="password"
type="java.lang.String"
update="true"
insert="true"
column="password"
/>
<set
name="items"
lazy="true"
inverse="true"
cascade="save-update"
sort="unsorted"
>
<key
column="seller"
/>
<one-to-many
class="org.hibernate.workshop.toolset.Item"
/>
</set>
<set
name="bids"
lazy="true"
inverse="true"
cascade="save-update"
sort="unsorted"
>
<key
column="buyer"
/>
<one-to-many
class="org.hibernate.workshop.toolset.Bid"
/>
</set>
<!--
To add non XDoclet property mappings, create a file named
hibernate-properties-User.xml
containing the additional properties and place it in your merge
dir.
-->
</class>
</hibernate-mapping>
-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills. Sign up for IBM's
Free Linux Tutorials. Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel