Hi,

In any  application if we use proxy  object which was
instantiated from the interface  and using the same
proxy object to Hibernate Api we should be able store,
update or delete data.

We were able to make the Hibernate API to work with
interface with some changes and implementing few other
class for creating proxy object using java reflection.
I thought it is a kind good feature for hibernate to
support with interfaces.

Here are steps
1.Define interface name in mapping file same as class 
name .
      <class name="com.test.to.TestAccountBean"
table="TEST_ACCOUNT">
 where TestAccountBean is an interface. Rest
everything in mapping       file remains same.


2.Now Create a proxy object using interface, Class
which generates proxy object is implemented to 
generate the hashcode() and equals() method for the
proxy object generated from interface.

3.Now using this proxy object we can save, delete or
update.

4.when retrieving values it is possible from hibernate
API to identify whether it is an interface, if it is
an interface then it will generate the proxy object
and send back to use

5.Other than 2 new files( for generating proxy) we
found that there is required to make    changes at
Hinernate api for these 3 file. 
      net.sf.hibernate.impl SessionFactoryImpl.
     
net.sf.hibernate.persister.AbstractEntityPersister 
      net.sf.hibernate.type ComponentType 

If  it makes sense and finds worth to be part of
hinernate, we will be happy to post those files and
changes made. As generating proxy object using
interface is provided by JDK and application using
proxy object no need to copy to other Hibernate
related Object to support for hibernate API.

Looking forward for the concerned person reply.

Thanks
Srinivas



        
                
__________________________________
Do you Yahoo!?
Win a $20,000 Career Makeover at Yahoo! HotJobs  
http://hotjobs.sweepstakes.yahoo.com/careermakeover 


-------------------------------------------------------
This SF.Net email is sponsored by Sleepycat Software
Learn developer strategies Cisco, Motorola, Ericsson & Lucent use to 
deliver higher performing products faster, at low TCO.
http://www.sleepycat.com/telcomwpreg.php?From=osdnemail3
_______________________________________________
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel

Reply via email to