-->
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: Dynamic model & dynamic table
PostPosted: Mon Jan 25, 2010 4:50 pm 
Newbie

Joined: Wed May 06, 2009 4:38 pm
Posts: 12
Hi,

I've been looking at Hibernate's dynamic model concept, and MAP entity mode which allows one to manage persistent data without implementing any java class representing the database mapped table. Instead, hashmap represents entities.

This is very nice, but in every example I have seen, tables columns are still referenced in the mapping file.

I would like to know if it is possible to omit the table column names in the mapping file and to combine this with MAP entity mode, in order to allow the table to be altered at runtime (to add or remove columns) witout reloading configuration ?

For example, let's take a Document as entity :

Code:
<hibernate-mapping>
<class entity-name="Document" table="DOCUMENT">
<id name="id" type="int" column="ID">
<generator class="native"/>
</id>
</class>
</hibernate-mapping>


the mapped table may be like this :

Code:
CREATE TABLE `DOCUMENT` (
  `ID` int(11) NOT NULL,
  `NAME` varchar(50) default NULL
  `CREATION` datetime NOT NULL,
)


Would NAME and CREATION fields be accessible in a hashmap representing DOCUMENT table data ?

Best regards,
Eric


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.