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: Inheritance/Key problem
PostPosted: Fri Nov 14, 2008 7:56 am 
Newbie

Joined: Fri Nov 14, 2008 7:43 am
Posts: 7
HI there!
I am developing a little application using Silverlight/WCF & NHibernate. I have several classes wich descend from a class named "Master". This class only contains a property named Id wich will be generated navitely. I have done this in order to avoid having always the same field "id" in every class. My problem is that I don't know how to map it . Actually I have a xml file named "User.hbm.xml", whose code is :

Code:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="Save" namespace="Save.Domain">
 
  <class name="User">
    <id name="Id">
      <generator class="Save.Domain.Master"/>
    </id>

    <!--
    <bag name="LstAccess">
      <key column="Id"/>
      <one-to-many class="Access"/>
    </bag>

    <property name="State"/>
    <property name="Username"/>
    <property name="Password"/>

    <many-to-one class="Profile" column="Id" name="UserProfile"/>
    -->
  </class>
</hibernate-mapping>


I have beel reading nhibernate documentation, but the only way i find to do this is to have a unique file ( named "Master.hbm.xml" for instance ) with all the <subclass> tags ( each for every class I have ), but this will create a BIG "Master.hbm.xml" file ...

Any hints, suggestions ?

Regards,
Ivan Frias


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.