Hibernate knows the implementations of my interfaces. I know this because I can issue a "from Person" and get instances of PersonImpl back. Leveraging this functionality would be useful to me, because I want to write something like this:
Code:
class EntityFactory
{
static <E extends Entity> E newInstance(Class<E> interfaceClass) { ... }
}
Instead of writing my own code to do the resolution and reflective instantiation, I'd like to leverage Hibernate to do it for me. However, I can't seem to pinpoint the code that actually does this. I know about ClassMetadata.instantiate, but SessionFactory.getClassMetadata returns null if I pass it anything other than the actual implementation.
What classes/packages should I be looking in?