-->
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: Combining Mapping xml data with Configuration xml data
PostPosted: Wed Jan 17, 2007 8:34 pm 
Newbie

Joined: Wed Jan 17, 2007 8:19 pm
Posts: 1
I've read tons of posts about the class mapping xml metadata and tons about the database configuration xml data, but I have not been able to find topics about combining both pieces of metadata into one xml file.

I know the <hibernate-configuration> node offers a child node to import an assembly containing the class mapping xml metadata, but is there not a way to nest the <hibernate-mapping> node within the <hibernate-configuration> ?

An example(that does not work) might be:

Code:
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
  <session-factory name="xyz">
    <!-- properties -->
    <property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property>
    <property name="connection.driver_class">NHibernate.Driver.SqlClientDriver</property>
    <property name="connection.connection_string">Server=localhost;initial catalog=nhibernate;User Id=;Password=</property>
    <property name="show_sql">false</property>
    <property name="dialect">NHibernate.Dialect.MsSql2000Dialect</property>
    <property name="use_outer_join">true</property>

  <hibernate-mapping>
    <class name="BusinessEntities.Class, Assembly" table="SalesOrder">
      <id name="OrderId" column="SalesOrderId" type="String" length="20">
        <generator class="assigned" />
      </id>
      <property name="ItemNumber" column="ItemNumber" type="String" length="40"/>
    </class>
  </hibernate-mapping>
  </session-factory>
</hibernate-configuration>

or something along these lines..... So the final affect would be to give the Configuration.Configure() method one file.

thanks


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.