The code is essentially:

class ParentClass
{
  private int _myProperty;

  ParentClass()
  {
  }

  public virtual int MyProperty()
  {
    get; set;
  }
}


class ChildClass : ParentClass
{
  ChildClass()
  {
    int myPropertyValue = base.MyProperty()
  }
}

With mapping files similar to:

<class name="ParentClass" table="`ParentClass`" lazy="false">
        <id name="Id" access="field.camelcase-underscore">
                <column name="id" not-null="true" />
                <generator class="identity"/>
        </id>
        <property name="MyProperty" access="field.camelcase-underscore">
                <column name="my_property" not-null="true" />
        </property>
</class>

<joined-subclass name="ChildClass" table="`ChildClass`"
extends="ParentClass" lazy="false">
        <key column="child_id" foreign-key="parent_id"/>
</joined-subclass>

On Aug 24, 12:58 am, Fabio Maulo <[email protected]> wrote:
> the code please
>
> 2009/8/21 Seth Goldstein <[email protected]>
>
>
>
>
>
> > We have run into a problem with the latest version of NHibernate that
> > has us totally stumped.  We have an inherited table schema using
> > joined-subclasses in the mapping file.  And the business layer matches
> > this schema.  In the constructor of one of the inherited classes, it
> > tries to reference a property on the parent object, but fails with an
> > “object reference not set to an instance of an object” exception.  In
> > that code, I am a proxy and it is trying to reference that property
> > fails since the property is on the object itself but not the proxy?
> > This used to work just fine in NHibernate 1.2, but fails since our
> > upgrade to 2.1 GA.  Do you have any ideas that might assist us?
> > Thanks a lot for any information you can provide.  Will a call stack
> > help?  Thanks again!
>
> --
> Fabio Maulo
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to