-->
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.  [ 2 posts ] 
Author Message
 Post subject: joined-subclass problem
PostPosted: Thu Jun 09, 2005 12:15 pm 
I have a field with the same name in both tables. How do I get NHibernate to update both fields with the same value. At the moment I can get it to set either but not both.

Code:
   <class name="NH_FF_TestApp.Party, NH-FF-TestApp" table="tblParty874a">
      <id name="Wid" column="PartyWID" type="String" length="20">
         <generator class="assigned" />
      </id>
      <property name="MainName" />
      <property name="TableCode" />
      <property name="ClientRefWID" />
      <property name="PartyTypeWID" />
   </class>
   <joined-subclass name="NH_FF_TestApp.Person, NH-FF-TestApp" extends="NH_FF_TestApp.Party, NH-FF-TestApp"
      table="tblClientPerson910">
      <key column="WID" />
      <property name="Surname" />
      <!--
      <property name="ClientRefWID" />
      -->
   </joined-subclass>


Code:
   public class Party
   {
      private string _wid;
      private string _mainName;
      private int _tableCode;
      private string _clientRefWID;
      private string _partyTypeWID;

      public Party()
      {
      }

      public virtual string Wid
      {
         get { return _wid; }
         set { _wid = value; }
      }

      public virtual string MainName
      {
         get { return _mainName; }
         set { _mainName = value; }
      }

      public virtual int TableCode
      {
         get {return _tableCode;}
         set {_tableCode = value;}
      }

      public virtual string ClientRefWID
      {
         get {return _clientRefWID;}
         set {_clientRefWID = value;}
      }      

      public virtual string PartyTypeWID
      {
         get {return _partyTypeWID;}
         set {_partyTypeWID = value;}
      }   
   }
   public class Person:Party
   {
      private string _surname;
//      private string _wid;
//      private string _clientRefWID;

      public Person()
      {
      }

//      public virtual string Wid
//      {
//         get { return _wid; }
//         set { _wid = value; }
//      }

      public virtual string Surname
      {
         get { return _surname; }
         set { _surname = value; }
      }

//      public new string ClientRefWID
//      {
//         get {return base.ClientRefWID;}
//         set {base.ClientRefWID = value;}
//      }      
   }



The ClientRefWID is a required field in both tables.

Regards
Tim


Top
  
 
 Post subject:
PostPosted: Fri Jun 10, 2005 5:55 am 
This is not a problem. I messed up elsewhere. :oops:
Tim


Top
  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

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.