Hello,
we want to use Hibernate in our project, but we have the need, that we just want to change the mapping-xml-file to add new attributes to database tables on the fly. We don't want to add a Java Bean each time, so that we have to deploy the software every time to the users.
So I came along the dynamic models in the reference documentation:
http://www.hibernate.org/hib_docs/v3/re ... amicmodels
(this is for 3.0.5, but for 3.1rc2 it's the same)
And the first sentence scared me:
"Note that the following features are currently considered experimental and may change in the near future."
A look into the source code of Hibernate 3.0.5 leads me to the class DynamicMapInstantiator and the following Method:
Code:
public boolean isInstance(Object object) {
if ( object instanceof Map ) {
//TODO: what about polymorphism?
if (entityName==null) return true;
String type = ( String ) ( ( Map ) object ).get( "type" );
return type == null || entityName.equals( type );
}
else {
return false;
}
}
And this "TODO" scared me even more.
So, can I use this feature or what limitations can I expect???
A look into the source code of Hibernate 3.1rc2 shows, that the class DynamicMapInstantiator has been modified all over and there is no "TODO" any more.
So, can I use dynamic models with polymorphism in 3.1rc2 without
any limitations???
Thanks for you help,
Volker