-->
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: I need a suggestion here: have to fix a project-design probl
PostPosted: Wed Feb 21, 2007 2:01 pm 
Newbie

Joined: Wed Feb 21, 2007 1:48 pm
Posts: 8
I have this problem:

inherhitance tree:

PersistentObject
|
| - Agent
|
| - User
| - Group


the project was built with lazy='false' everywhere in the mappings.
So you can image the performance of it... now i have to improve this system, and the time is short.

First thing i did was to set all lazy as true, but this implied in a lot of problems (most involved with polimorphism and instanceof).

I have in one place, one problem, that reproces itself everywhere on the system, its the following:

i need to do a instanceof of one Agent, and then cast it to User or Group
with lazy='false' this works perfectly
but with lazy='true' i get:

java.lang.ClassCastException: com.company.project.model.Agent$$EnhancerByCGLIB$$71276b45

the object is not User neither Group
Its proxying the Agent

BEST SOLUTION I CAN THINK:

is there any way the proxy override the right instance?
so when i print the object i get com.company.project.model.User$$EnhancerByCGLIB$$71276b45 or com.company.project.model.Group$$EnhancerByCGLIB$$71276b45

I apreciate the time spent to read this


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.