What I want to do with Hibernate is basically replace Java as its static metamodel by my own, dynamic one. However, if I look at the CompositeUserType interface methods such as getPropertyNames() and getPropertyTypes() they imply that implementions (design time) know what the actual schema.
Of course, nobody would change the schema after the database tables were created but I would like to create a generic "bridge" between Hibernate and my own metamodel. And from my limited understandin of Hibernate, that does not seem possible.
I would imagine to see instead something like:
public String[] getPropertyNames(Object type)
{
MyType type = (MyType)type;
return type.getPropertyNames();
}
public Type[] getPropertyTypes(Object type);
{
// similar here
}
so that at I could create a single CompositeUserType that would bridge my metamodel to Hibernate dynamically at runtime. It is up to the application or metamodel framework to garantee that the schema will not change after the database tables were created.
Am I missing something here?
thanks
|