-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: AbstractEntityPersister calling wrong setter?
PostPosted: Tue Jun 22, 2004 11:59 am 
Newbie

Joined: Mon Jun 21, 2004 2:21 pm
Posts: 7
Location: New York, NY
I have a weird problem going on. I use Hibernate 2.1.3

The base class of my class hierarchy is not being persisted properly. When I stop the debugger at AbstractEntityPersister.221 and step through the for loop, the BasicPropertyAccessors and the values do not sync up

I then get an IllegalArgumentException when the value of the 'mediaType' property, a String, is attempted to be used as the value to the call the setter for the version property 'modifiedDate', which expects a Timestamp

There are the right number of BasicPropertyAccessors and values, they are just not in the right order. Can anyone tell me how to fix this?

The mapping for the base class looks like this.

<?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
package="market.media.bean">

<class name="MediaBean" table="RIGHTS_MEDIA">
<cache usage="read-write"/>

<id name="id" column="RIGHTS_MEDIA_TKEY">
<generator class="market.util.IdentifierGenerator">
<param name="sequence">RIGHTS_MEDIA_TKEY_SEQ</param>
</generator>
</id>

<version access="property" name="modifiedDate" type="market.util.TimestampDateType" column="MODIFIED_DATE"/>

<property name="mediaType" column="RIGHTS_MEDIA_TYPE"/>

<property name="backloadId" column="BACKLOAD_ID"/>

<property name="name" not-null="true" column="RIGHTS_MEDIA_NAME"/>
<property name="abbreviation" not-null="true" column="RIGHTS_MEDIA_ABBR"/>
<property name="description" column="RIGHTS_MEDIA_DESC"/>
<property name="modifiedBy" not-null="true" column="MODIFIED_BY"/>

</class>


</hibernate-mapping>


Thanks!


Top
 Profile  
 
 Post subject: Cache related?
PostPosted: Tue Jun 22, 2004 5:27 pm 
Newbie

Joined: Mon Jun 21, 2004 2:21 pm
Posts: 7
Location: New York, NY
Ok, when I remove the cache element from the mapping file, things work OK.

Is there anything special I have to do for table per class mapping with caching turned on????


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.