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