-->
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.  [ 4 posts ] 
Author Message
 Post subject: Examples of creating custom ClassPersister
PostPosted: Fri Jul 02, 2004 2:57 am 
Regular
Regular

Joined: Mon Feb 23, 2004 10:42 pm
Posts: 102
Location: Washington DC
Is there any documentation or examples regarding how one can go about extending some of the hibernate internals with custom components? I have reviewed the docs and thought I would ask before taking the task of trial and error with the code.

-Matt


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 02, 2004 3:04 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
Well, there are many wiki entries about implementing custom UserTypes, Interceptors, and Lifecycles.

I've not really seen much docs or examples of creating custom ClassPersister implementations. There is one custom ClassPersister in the test suite. Other than that there is always the source code; start with AbstractEntityPersister and EntityPersister.

Is there something in particular you are trying to do?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 02, 2004 3:15 am 
Regular
Regular

Joined: Mon Feb 23, 2004 10:42 pm
Posts: 102
Location: Washington DC
We are trying to get Hibernate not to rely on concrete classes. I was able to dig up information about dynamic-class, basically a Map that represents an object. We have our own object that is esentially a map of somesorts with name/value pairs, but a lot more. We are trying to use this instead of the Map so we can avoid having to take the results of the map and them wrap the map objects into our own objects.

We have also found that we can use PropertyAccessor to handle the getter/setter issue for own own custom objects. Now the big issue comes with actually creating instances of our own objects. ClassPersister might not be the correct place, but the method instantiate(serializable) looked promising for this if it could be overridden.

Any help would be much appreciated in the matter. Thanks again for all the good work you guys (and gals if there are any) that you have done.

-Matt


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 02, 2004 3:58 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
Well it depends exactly what you are trying to do. If all you really need is to be able to tie into entity instantiation, a lighter-weight way would be to implement Interceptor.instantiate().


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.