Hibernate version: 3.2
Name and version of the database you are using: Oracle10g
I am sorry if this information out there, I am really having a hard time finding a solution. Does anyone know a good strategy for how I might support interfaces by providing a mechanism to load the appropriate implementations?
To be more specific, here is an overview of the objects I have and what I want to do. We have a set of interfaces which are loaded via a custom factory. The factory allows us to provide alternate implementations by overriding the defaults.
For example:
Code:
Person p = Person.Factory.createPerson();
The factory can be further simplified to:
Code:
Person p = Factory.createApiObject(Person.class);
This factory uses a property file to determine if the implementation is provided by the user... if not, it defaults to a provided impl.
The problem is that I would like to hook these interface classes into hibernate, but I am not sure how to do this because I need to use the factory to obtain the instance. I cannot simply supply the implementing class in Person.hbm.xml as I would lose my ability to allow the user of my library to provide their own implementation (to Person).
So, does anyone know how I might provide a custom classloader to do this?
Any help you all could provide me would be greatly appreciated.