Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p><strike>Creating tables and entities dynamically is IMO not a good idea. Hibernate is not really made for that and generating entities is only a <strong>small part</strong> of the problem. You would have to add them to the configuration, rebuild a session factory, update the model. And what about subsequent restarts of the application?</strike> Not recommended, just forget this approach...</p> <p>Another option would be to use an <a href="http://en.wikipedia.org/wiki/Entity-attribute-value_model" rel="nofollow noreferrer">Entity-Attribute-Value (EAV)</a> model. This is something many CMS are doing. I've never implemented this with Hibernate but it's doable (and has already been done). Here are some resources:</p> <ul> <li><a href="https://forum.hibernate.org/viewtopic.php?t=928399" rel="nofollow noreferrer">Adding new persistable classes at runtime</a></li> <li><a href="http://lists.jboss.org/pipermail/hibernate-dev/2007-April/001831.html" rel="nofollow noreferrer">[hibernate-dev] dynamic entities</a> (has some sources attached)</li> </ul> <p>But to be honest, I wouldn't implement my own CMS but rather reuse an existing one. <a href="http://www.onehippo.com/" rel="nofollow noreferrer">One Hippo</a> seems to be a candidate.</p> <h3>See also</h3> <ul> <li><a href="http://sankuru.biz/fr/blog/8-joomla-configuration-issues/35-the-cck-buzz-content-creation-kit-and-the-eav-problem.html" rel="nofollow noreferrer">The CCK buzz (Content Creation Kit) and the EAV problem</a> </li> </ul> <h3>Related questions</h3> <ul> <li><a href="https://stackoverflow.com/questions/870808/entity-attribute-value-database-vs-strict-relational-model-ecommerce-question">Entity Attribute Value Database vs. strict Relational Model Ecommerce question</a></li> <li><a href="https://stackoverflow.com/questions/1310630/approach-to-generic-database-design">Approach to generic database design</a></li> <li><a href="https://stackoverflow.com/questions/1945062/how-do-you-build-extensible-data-model">How do you build extensible data model</a></li> <li><a href="https://stackoverflow.com/questions/2054508/i-am-looking-for-something-similar-to-the-drupal-cck-but-in-java-in-a-java-cms">I am looking for something similar to the drupal CCK, but in Java (in a Java CMS)?</a> </li> <li><a href="https://stackoverflow.com/questions/1205793/java-frameworks-that-support-entity-attribute-value-models">Java Frameworks that support Entity-Attribute-Value Models</a></li> <li><a href="https://stackoverflow.com/questions/2646035/implementing-eav-pattern-with-hibernate-for-user-settings-relationship">Implementing EAV pattern with Hibernate for User -> Settings relationship</a></li> </ul>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload