These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: HELP NEEDED: Dynamic Models (and Polymorphism)
PostPosted: Fri Oct 28, 2005 12:01 pm 
Newbie

Joined: Fri Oct 28, 2005 11:27 am
Posts: 3
Location: Germany
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.