-->
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: Hibernate Dynamic Models
PostPosted: Mon Oct 21, 2013 5:37 pm 
Newbie

Joined: Mon Oct 21, 2013 5:32 pm
Posts: 8
I am going through the Hibernate documentation and came across the concept of Hibernate Dynamic Models : http://docs.jboss.org/hibernate/orm/3.6/reference/en-US/html/persistent-classes.html#persistent-classes-dynamicmodels

I understood that using Dynamic Models concept we need not write any POJO classes separately and we just need to write a mapping file. Practically when we will be using this feature?

Also the document says:

Quote:
One of the main advantages of dynamic mapping is quick turnaround time for prototyping, without the need for entity class implementation. However, you lose compile-time type checking and will likely deal with many exceptions at runtime. As a result of the Hibernate mapping, the database schema can easily be normalized and sound, allowing to add a proper domain model implementation on top later on.


Can you please help me in understanding the advantages of it, I was not able to get what it means.

Also the document says:

Code:
Session dynamicSession = pojoSession.getSession(EntityMode.MAP);


Quote:
Please note that the call to getSession() using an EntityMode is on the Session API, not the SessionFactory. That way, the new Session shares the underlying JDBC connection, transaction, and other context information. This means you do not have to call flush() and close() on the secondary Session, and also leave the transaction and connection handling to the primary unit of work.


In this I understand that pojoSession is same as Session object and what is the secondary Session as per the statements.

Please help me in understanding the dynamic models concept of Hibernate 3.x.


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.