-->
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: Transparent injection of code in java
PostPosted: Tue Jun 24, 2008 10:38 am 
Newbie

Joined: Tue Jun 24, 2008 10:01 am
Posts: 1
This is not just a question about hibernate use but about its cool architecture. This is my problem:

I am a java programmer and I need to create dynamic proxies for my business objects. Java reflections facilities permit solve this problem but only when business object implements a set of interfaces (by creating a class implementing java.lang.reflect.InvocationHandler and using the factory method java.lang.reflect.Proxy.newProxyInstance).

I have posted this question in other forum obtaining no response but I know that Hibernate architecture solve exactly this problem. A persistent business object managed for hibernate and delivered to the programmer is not a real business object but a proxy implementing, among other things, lazy initialization logic for collections.

Please somebody could tell me how Hibernate creates dynamic proxies for objects implementing no interfaces?

Thanks in forward.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 24, 2008 12:56 pm 
Newbie

Joined: Tue Jun 24, 2008 11:52 am
Posts: 1
Location: London, UK
Hi

Take a look at the following http://www.hibernate.org/hib_docs/reference/en/html/performance.html#performance-fetching-proxies. The Hibernate proxy is actually a subclass of the persistent class, which it creates using CGLIB. CGLIB is probably what you want to be looking at, a good primer is here http://www.ociweb.com/jnb/jnbNov2005.html

I hope this helps


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.