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
|