-->
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: Programmatically changing mapping configuration
PostPosted: Wed May 16, 2007 7:59 am 
Newbie

Joined: Wed May 16, 2007 7:17 am
Posts: 7
Hi,

I would like to, programatically at initialisation, be able to add additional <property /> tags to the <dynamic-component /> section in the following mapping.

Code:
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" default-lazy="false">
  <class name="Test.Bug, Test" table="bugs">
    <id name="Id" column="id" type="Int64">
      <generator class="sequence">
        <param name="sequence">bugs_id_seq</param>
      </generator>
    </id>
    <property name="Title" column="title" type="String" not-null="true" />
    <property name="CreatedOn" column="createdon" type="DateTime" not-null="true" />
    <property name="CreatedBy" column="createdby" type="Int64" not-null="true" />
   <dynamic-component name="CustomData">
      <property name="col_1" column="col_1" type="Int64" />
      <property name="col_2" column="col_2" type="Int64" />
    </dynamic-component>
  </class>
</hibernate-mapping>


I have extensivly searched the forums and docs, and have found a couple of posts from people saying that had managed to do this, but no mention of how.

The docs also mention that "Runtime manipulation of the mapping document is also possible, using a DOM parser" - does this mean the file itself prior to it being parsed or the DOM model used by the configuration object?

In this url someone says they have managed it:
http://forum.hibernate.org/viewtopic.php?t=972395&highlight=dynamiccomponent

And I have also read a post from Ayende Rahien giving a very high level view of what to do, but can not find it now.

Any pointers in the right direction would be much appreciated. :)

Thanks
Chris


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.