-->
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: Resultset with actual objects and not the proxies
PostPosted: Thu Jun 09, 2011 6:12 am 
Newbie

Joined: Tue Jun 07, 2011 1:02 pm
Posts: 7
Is there any way that the results that are returned by hibernate (.list() or .uniqueResult) dont have any proxy for lazy initialization? I can do lazy="false" but i dont want it due to design constraints. Similarly I can test individual fields whether they are instanceof HibernateProxy and if they are, I can use 'proxy.getHibernateLazyInitializer().getImplementation()' BUT this seems not to be a good approach. I think there should be some way in hibernate that it will return the actual objects instead of proxy or some utility method for it. The things become more complicated if the design of business object is complex and there are multiple occurrences of proxies in much deeper depth (e.g. one Proxy exist within a DTO within a DTO within a DTO that is part of a List) of the business object/DTO.
I want resultset without any proxy to send it back to the caller layer so that they dont have any issues. (Specially Lazy Initialization and they are also using code generation)


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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.