-->
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: Inheritance and caching
PostPosted: Sun Jan 15, 2006 6:19 pm 
Newbie

Joined: Sun Jan 15, 2006 5:57 pm
Posts: 1
Here is the class hierarchy I have:
Person
-superClassOf-> StaffMember
-superClassOf-> VIP

What's happening is the same person is a StaffMember and VIP. So when I try
and load them both into memory, Hibernate seems to try and cast a StaffMember
to a VIP (an vice versa) depending on which is loaded first.

I know that this may not be the best design. Any way I can work around this?
Code:
Exception in thread "main" org.hibernate.PropertyAccessException: exception setting property value with CGLIB (set hibernate.cglib.use_reflection_optimizer=false for more info) setter of com.jfys.datafest.domain.EventVip.setVip
   at org.hibernate.tuple.PojoEntityTuplizer.setPropertyValuesWithOptimizer(PojoEntityTuplizer.java:215)
   at org.hibernate.tuple.PojoEntityTuplizer.setPropertyValues(PojoEntityTuplizer.java:185)
   at org.hibernate.persister.entity.AbstractEntityPersister.setPropertyValues(AbstractEntityPersister.java:3232)
   at org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:126)
...
Caused by: net.sf.cglib.beans.BulkBeanException: com.jfys.datafest.domain.ArtisticCompany
   at com.jfys.datafest.domain.EventVip$$BulkBeanByCGLIB$$d52d879a.setPropertyValues(<generated>)
   at org.hibernate.tuple.PojoEntityTuplizer.setPropertyValuesWithOptimizer(PojoEntityTuplizer.java:212)
   ... 15 more
Caused by: java.lang.ClassCastException: com.jfys.datafest.domain.ArtisticCompany
   ... 17 more


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 15, 2006 10:32 pm 
Expert
Expert

Joined: Thu Dec 23, 2004 9:08 pm
Posts: 2008
Can you post your mapping, with at least the class, subclass and discriminator parts?


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.