0

以下のようなマッピングと POCO があります。問題はtbFNamesFeature、このオブジェクトが保存されたときに更新されていないことです (一方、tblFeature) に対してさまざまな値を試しましたがcascade、効果がなかったので、得られないものがあると言わざるを得ません。(xml の ??? を参照)。
私は何を間違っていますか?

tbFNamesFeature2 つの列があります。

FNamesId (PK、int、null 以外)
FeatureId (PK、int、null 以外)

<?xml version="1.0" encoding="utf-8"?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
  <class name="Feature, Infrastructure.Interface"
         table="tblFeature">
    <id name="Id" type="Int32" unsaved-value="0">
      <column name="FeatureId" sql-type="int" not-null="true" unique="true" index="PK_tblFeature" />
      <generator class="native" />
    </id>
    <property name="Description" type="String">
      <column name="Description" length="100" sql-type="varchar" not-null="false" />
    </property>
    <bag name="FNames" table="tbFNamesFeature" inverse="true" lazy="false" cascade="???">
      <key>
        <column name="FeatureId" sql-type="int" not-null="true" />
      </key>
      <many-to-many class="FName, Infrastructure.Interface">
        <column name="FNamesId" sql-type="int" not-null="true" />
      </many-to-many>
    </bag>
  </class>
</hibernate-mapping>

Feature.cs

public partial class Feature : System.IComparable
{
        protected int id;
        protected string description;

        public virtual int Id
        {
            get { return this.id; }
            set { this.id = value; }
        }

        public virtual string Description
        {
            get { return this.description; }
            set { this.description = value; }
        }
}

Feature.part.cs

public partial class Feature : System.IComparable
{
        private System.Collections.Generic.IList<FName> fnames;

        public virtual System.Collections.Generic.IList<FName> FNames
        {
            get
            {
                if (this.fnames == null)
                {
                    this.fnames = new System.Collections.Generic.List<FName>();
                }
                return this.fnames;
            }
            set {
                this.fnames = value;
            }
        }
 }
4

1 に答える 1