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.  [ 1 post ] 
Author Message
 Post subject: Problem refreshing with subclass
PostPosted: Tue Apr 08, 2008 8:55 pm 
Newbie

Joined: Tue Apr 08, 2008 8:43 pm
Posts: 1
Hibernate version: 3.1.2

I have an object with an one-to-one association. This one-to-one object have several subclasses using a discriminator value. Some of the subclasses have join table.

When I do a refresh of the first object, I got a ClassCastException because, for some reason, Hibernate tries to set a value from the subclassed object to the one-to-one.

I got the following exception:

19:12:04,631 ERROR BasicPropertyAccessor:94 - IllegalArgumentException in class: br.com.visanet.scu.vo.prsr.PrivateLabelVO, setter method of property: qtMinimaParcela
19:12:04,646 ERROR BasicPropertyAccessor:98 - expected type: java.lang.Integer, actual value: java.lang.Integer

PrivateLabelVO has the property qtMinimaParcela and the setters and getters and the value for both is an Integer.

The problem is that Hibernate tries to set this value to his extend class, which doesn't have this property. I realized that Loader.loadEntity at line 1785 when tries to doQueryAndInitializeNonLazyCollections sends an optionalObject as parameter and this optionalObject points to the extended class and not to its subclass.

Is this right?
Why this problem occurs only at the refreshment?

Thanks in advance.
Luiz.


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

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.