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)
|
|