-->
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: Need to get Loader to call factory method to create instance
PostPosted: Sun Aug 07, 2005 1:03 am 
Newbie

Joined: Sun Aug 07, 2005 12:53 am
Posts: 2
I've been searching the code base and forums, but with no luck. I would like to get the PojoInstantiator to call a factory method to create a new instance of an object in the instantiate() method rather then having it call the default constructor on the class itself, like it does now.(Version 3.0 or higher)

The specific reason for this is I would like to have objects that are rehydrated by hibernate to be instantiated by Spring so behavior is injected into the objects themselves directly when they are produced from the database. I realize that one could create a custom entity persister, but I have been unable to find a proper example to follow.

So, I guess the questions are a) can this be easily done, and b) if not, is there a good example of a custom persister that someone can point me to?

Thanks,
Ned


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 07, 2005 1:21 am 
Newbie

Joined: Sun Aug 07, 2005 12:53 am
Posts: 2
Let me add to this, is the easiest method to do this to extend the SingleTableEntityPersister and implement the method instantiate(Serializable id, EntityMode entityMode)? If so, is that going to change in the future? (future=hibernate 3.1)

Thanks again


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.