|
I had the exact same problem in migrating to Hibernate. Our domain model only refers to the collection interfaces (e.g. List), but we have custom implementations that would take a long time to replace with a different strategy.
I solved the problem with a bit of a "hack" solution, because I didn't see a way that user customization was intended with the persistent collections. This would be a nice extention point, BTW, hint hint. :-)
What I did was extend the Hibernate implementations to add some of my own functionality (e.g. extended the Bag class). But in order to get Hibernate to use the class, I had to also extend the corresponding Bag class in the mapping package and the BagType class in the type package.
Then I had to programmatically loop through the objects in the Configuration instance (after loading all the config files) and replace "Bag" mappings with my own "Bag" extension. It was a bit of a pain.
|