I have an entity hierarchy, using a discriminator column.  The base
class is called Equipment and the derived class is called Tool.  I can
load and query entities just fine, but when I go to Save an entity
that I've modified, it get this error:

No persister for: Castle.Proxies.ToolProxy

I find that odd.  I'm able to save against a SQLite database in my
unit tests.  I was also able to save a new Tool that I created.  I
just wasn't able to save one I'd loaded earlier.

Now I loaded it in a previous session, and I'm thinking that could be
the problem, but I thought NHibernate would take care of entities that
were detached from sessions and put back into new sessions.  Perhaps
you can enlighten me.

Here's my mapping file:

  <class
    name="Equipment"
    table="EQUIPMENT"
    discriminator-value="0">
    <id name="Id" column="EQUIPMENT_ID">
      <generator class="guid"/>
    </id>
    <discriminator
      column="EQUIPMENTTYPE"
      not-null="true"
      type="System.Int32"/>
    <component name="AuditHistory">
      <property name="CreationDate" column="CREATION_DATE"
type="Timestamp"/>
      <property name="CreatedBy" column="CREATED_BY"/>
      <property name="LastModifiedDate" column="LASTMODIFIED_DATE"
type="Timestamp"/>
      <property name="LastModifiedBy" column="LASTMODIFIED_BY"/>
    </component>
    <property name="Deleted" column="DELETED"/>
    <many-to-one name="EquipmentSpecRevision"
class="EquipmentSpecRevision" column="EQUIPMENTSPECREV_ID" not-
null="true"
      fetch="join" cascade="save-update" lazy="no-proxy"/>
    <property name="EquipmentSite" column="EQUIPMENT_SITE"/>

    <subclass
      name="NetBom.Model.Domain.EquipmentManagement.Tools.Tool"
      discriminator-value="1">
      <property name="ToolNumber" column="TOOL_NUMBER"/>
      <property name="OriginalJobNumber" column="ORIGINALJOBNUM"/>
    </subclass>
  </class>

-- 
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