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.  [ 4 posts ] 
Author Message
 Post subject: composite-element mapping exception
PostPosted: Mon Jul 16, 2007 11:09 pm 
Newbie

Joined: Mon Jul 16, 2007 2:25 am
Posts: 7
Hi

I am receiving an Nhibernate MappingException when I'm trying to map a property of a class which is a collection which will have as an item a class that is ownned by another subject area(context). I wish to load only the foreign key into the class. The Client property is a custom collection that implements IUserCollectionType.

The nHibernate exception is
Error mapping generic collection GrantEd.DomainModel.ProgrammeMgmt.ClientPostingAccount.Clients: expected 1 generic parameters, but the property type has 2.

The two generic parameters are one to identify the type of class the collection contains and the second to identify the type of the key used for the collection.

Thanks
Peter

NHibernate versioin 1.2.0.4000

Mapping documents:
Code:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
   <class name="GrantEd.DomainModel.ProgrammeMgmt.ClientPostingAccount, GrantEd.DomainModel.ProgrammeMgmt" table="ClientPostingAccount">
      <id name="id" type="Int32" unsaved-value="null" access="field" >
         <column name="ClientPostingAccountId" length="4" sql-type="int" not-null="true" unique="true" index="PK_ClientPostingAccount" />
         <generator class="identity" />
      </id>
      
      <component name="Created" class="GrantEd.DomainModel.Core.Audit, GrantEd.DomainModel.Core">
         <property name="ActionDate" column="CreatedActionDate" type="DateTime" not-null="true"/>
         <property name="ActionUser" column="CreatedActionUser" type="String" length="50" not-null="true"/>
      </component>
      <component name="LastUpdated" class="GrantEd.DomainModel.Core.Audit, GrantEd.DomainModel.Core">
         <property name="ActionDate" column="LastUpdatedActionDate" type="DateTime" not-null="true"/>
         <property name="ActionUser" column="LastUpdatedActionUser" type="String" length="50" not-null="true"/>
      </component>
      
      <property name="Active" type="Boolean">
         <column name="Active" length="1" sql-type="bit" not-null="true"/>
      </property>
      <property name="Timestamp" type="Byte[]">
         <column name="`Timestamp`" length="8" sql-type="timestamp" not-null="true"/>
      </property>
      <many-to-one name="ProgrammeRound" class="GrantEd.DomainModel.ProgrammeMgmt.ProgrammeRound, GrantEd.DomainModel.ProgrammeMgmt">
         <column name="ProgrammeRoundId" length="4" sql-type="int" not-null="true"/>
      </many-to-one>
      
      <component name = "StateCd" >
         <property name="Id" column="StateCd" type="int" not-null="false" />
      </component>
      <many-to-one name="PostingAccount" class="GrantEd.DomainModel.ProgrammeMgmt.PostingAccount, GrantEd.DomainModel.ProgrammeMgmt">
         <column name="PostingAccountId" length="4" sql-type="int" not-null="true"/>
      </many-to-one>
      
      <set name="_clientTypeCodes" collection-type="GrantEd.DomainModel.Code.ClientTypeCodes, GrantEd.DomainModel.Code" table="ClientPostingAccountClientTypeCode" access="field" >
         <key column="ClientPostingAccountId"/>
         <many-to-many class="GrantEd.DomainModel.Code.ClientTypeCode, GrantEd.DomainModel.Code" column="ClientTypeId"/>         
      </set>

      <set name="Clients"  table="ClientPostingAccountClient" access="property" lazy="false">
         <key column="ClientPostingAccountId"/>
         <composite-element class="GrantEd.DomainModel.ClientMgmt.Clients, GrantEd.DomainModel.ClientMgmt">
            <property name="id" type="int"/>
         </composite-element>
      </set>      
   </class>
</hibernate-mapping>



Class definition
Code:
[Serializable]
public partial class ClientPostingAccount : DomainBase<int>, IAuditable , IAssignedId<int>
{
                private Audit _Created;
   private Audit _LastUpdated;
   protected bool _active;
   protected byte[] _timestamp;
   protected ProgrammeRound _programmeRound;
   protected StateCode _stateCd;
   protected PostingAccount _postingAccount;
   private IDomainCollection< ClientTypeCode, int> _clientTypeCodes ;
   private IDomainCollection< Client, int> _clients ;

   public ClientPostingAccount(): base()  { }

        #region IAssignedId<string> Members

        public void SetAssignedIdTo(int assignedId)
        {
            this.id = assignedId ;
        }
      
        #endregion
      
         public virtual Audit Created
        {
            get { return _Created; }
            set { _Created = value; }
        }
        public virtual Audit LastUpdated
        {
            get { return _LastUpdated; }
            set { _LastUpdated = value; }
        }
      
        [NotNullValidator]
        public virtual bool Active
        {
   get { return _active; }
   set { _active = value; }
         }
   
         public virtual byte[] Timestamp
         {
   get { return _timestamp; }
   set { _timestamp = value; }
          }

          public virtual ProgrammeRound ProgrammeRound
          {
   get { return _programmeRound; }
   set { _programmeRound = value; }
          }

          public virtual StateCode StateCd
          {
   get { return _stateCd; }
   set { _stateCd = value; }
          }

          public virtual PostingAccount PostingAccount
          {
   get { return _postingAccount; }
   set { _postingAccount = value; }
           }

           public virtual IDomainCollection< ClientTypeCode, int> ClientTypeCodes
          {
   get {
   //  NULL is returned if collection is lazy loaded.  This is to distinguish with the scenario where the collection is loaded but empty.
           if (!NHibernate.NHibernateUtil.IsInitialized(_clientTypeCodes))
          {
      _clientTypeCodes = null ;
           }
           return _clientTypeCodes;
   }
   set {_clientTypeCodes = value ;}
           }

           public virtual IDomainCollection< Client, int> Clients
           {
   get {
   //  NULL is returned if collection is lazy loaded.  This is to distinguish with the scenario where the collection is loaded but empty.
          if (!NHibernate.NHibernateUtil.IsInitialized(_clients))
         {
      _clients = null ;
          }
          return _clients;
         }
    set {_clients = value ;}
            }

}


Using SQL 2005

Debug level Hibernate log excerpt:
Code:
2007-07-17 10:18:26,714#[6]#INFO #NHibernate.Cfg.Environment#[(null)]# NHibernate 1.2.0.4000 (1.2.0.4000)
2007-07-17 10:18:26,714#[6]#INFO #NHibernate.Cfg.Environment#[(null)]# nhibernate section not found in application configuration file
2007-07-17 10:18:26,714#[6]#INFO #NHibernate.Cfg.Environment#[(null)]# Bytecode provider name : lcg
2007-07-17 10:18:26,714#[6]#INFO #NHibernate.Cfg.Environment#[(null)]# Using reflection optimizer
2007-07-17 10:18:26,714#[6]#INFO #NHibernate.Cfg.Configuration#[(null)]# Searching for mapped documents in assembly: GrantEd.DomainModel.Code
2007-07-17 10:18:26,730#[6]#INFO #NHibernate.Cfg.Configuration#[(null)]# Adding embedded mapping document: GrantEd.DomainModel.Code.NHibernate_Mapping.PaymentModeCode.hbm.xml
2007-07-17 10:18:26,730#[6]#INFO #NHibernate.Cfg.Configuration#[(null)]# Mapping resource: GrantEd.DomainModel.Code.NHibernate_Mapping.PaymentModeCode.hbm.xml
2007-07-17 10:18:26,808#[6]#INFO #NHibernate.Dialect.Dialect#[(null)]# Using dialect: NHibernate.Dialect.MsSql2005Dialect
2007-07-17 10:18:26,855#[6]#INFO #NHibernate.Cfg.HbmBinder#[(null)]# Mapping class: GrantEd.DomainModel.Code.PaymentModeCode -> PaymentModeCode
2007-07-17 10:18:26,901#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: Id -> PaymentModeCodeId, type: Int32
2007-07-17 10:18:26,901#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: name -> Name, type: String
2007-07-17 10:18:26,901#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: description -> Description, type: String
2007-07-17 10:18:26,901#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: active -> Active, type: Boolean
2007-07-17 10:18:26,917#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: ActionDate -> CreatedActionDate, type: DateTime
2007-07-17 10:18:26,917#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: ActionUser -> CreatedActionUser, type: String
2007-07-17 10:18:26,948#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: Created -> CreatedActionDate, CreatedActionUser, type: Audit
2007-07-17 10:18:26,948#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: ActionDate -> LastUpdatedActionDate, type: DateTime
2007-07-17 10:18:26,948#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: ActionUser -> LastUpdatedActionUser, type: String
2007-07-17 10:18:26,948#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: LastUpdated -> LastUpdatedActionDate, LastUpdatedActionUser, type: Audit
2007-07-17 10:18:26,948#[6]#INFO #NHibernate.Cfg.Configuration#[(null)]# Adding embedded mapping document: GrantEd.DomainModel.Code.NHibernate_Mapping.StateCode.hbm.xml
2007-07-17 10:18:26,948#[6]#INFO #NHibernate.Cfg.Configuration#[(null)]# Mapping resource: GrantEd.DomainModel.Code.NHibernate_Mapping.StateCode.hbm.xml
2007-07-17 10:18:26,948#[6]#INFO #NHibernate.Dialect.Dialect#[(null)]# Using dialect: NHibernate.Dialect.MsSql2005Dialect
2007-07-17 10:18:26,948#[6]#INFO #NHibernate.Cfg.HbmBinder#[(null)]# Mapping class: GrantEd.DomainModel.Code.StateCode -> StateCode
2007-07-17 10:18:26,948#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: Id -> StateCodeId, type: Int32
2007-07-17 10:18:26,948#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: name -> Name, type: String
2007-07-17 10:18:26,948#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: description -> Description, type: String
2007-07-17 10:18:26,948#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: active -> Active, type: Boolean
2007-07-17 10:18:26,948#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: ActionDate -> CreatedActionDate, type: DateTime
2007-07-17 10:18:26,948#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: ActionUser -> CreatedActionUser, type: String
2007-07-17 10:18:26,948#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: Created -> CreatedActionDate, CreatedActionUser, type: Audit
2007-07-17 10:18:26,948#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: ActionDate -> LastUpdatedActionDate, type: DateTime
2007-07-17 10:18:26,948#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: ActionUser -> LastUpdatedActionUser, type: String
2007-07-17 10:18:26,948#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: LastUpdated -> LastUpdatedActionDate, LastUpdatedActionUser, type: Audit
2007-07-17 10:18:26,948#[6]#INFO #NHibernate.Cfg.Configuration#[(null)]# Adding embedded mapping document: GrantEd.DomainModel.Code.NHibernate_Mapping.AuthorizationPermissionTypeCode.hbm.xml
2007-07-17 10:18:26,948#[6]#INFO #NHibernate.Cfg.Configuration#[(null)]# Mapping resource: GrantEd.DomainModel.Code.NHibernate_Mapping.AuthorizationPermissionTypeCode.hbm.xml
2007-07-17 10:18:26,948#[6]#INFO #NHibernate.Dialect.Dialect#[(null)]# Using dialect: NHibernate.Dialect.MsSql2005Dialect
2007-07-17 10:18:26,948#[6]#INFO #NHibernate.Cfg.HbmBinder#[(null)]# Mapping class: GrantEd.DomainModel.Code.AuthorizationPermissionTypeCode -> AuthorizationPermissionTypeCode
2007-07-17 10:18:26,948#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: Id -> AuthorizationPermissionTypeCodeId, type: Int32
2007-07-17 10:18:26,948#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: name -> Name, type: String
2007-07-17 10:18:26,948#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: description -> Description, type: String
2007-07-17 10:18:26,948#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: active -> Active, type: Boolean
2007-07-17 10:18:26,948#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: ActionDate -> CreatedActionDate, type: DateTime
2007-07-17 10:18:26,948#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: ActionUser -> CreatedActionUser, type: String
2007-07-17 10:18:26,948#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: Created -> CreatedActionDate, CreatedActionUser, type: Audit
2007-07-17 10:18:26,948#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: ActionDate -> LastUpdatedActionDate, type: DateTime
2007-07-17 10:18:26,948#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: ActionUser -> LastUpdatedActionUser, type: String
2007-07-17 10:18:26,948#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: LastUpdated -> LastUpdatedActionDate, LastUpdatedActionUser, type: Audit
2007-07-17 10:18:26,948#[6]#INFO #NHibernate.Cfg.Configuration#[(null)]# Adding embedded mapping document: GrantEd.DomainModel.Code.NHibernate_Mapping.SectorCode.hbm.xml
2007-07-17 10:18:26,964#[6]#INFO #NHibernate.Cfg.Configuration#[(null)]# Mapping resource: GrantEd.DomainModel.Code.NHibernate_Mapping.SectorCode.hbm.xml
2007-07-17 10:18:26,964#[6]#INFO #NHibernate.Dialect.Dialect#[(null)]# Using dialect: NHibernate.Dialect.MsSql2005Dialect
2007-07-17 10:18:26,964#[6]#INFO #NHibernate.Cfg.HbmBinder#[(null)]# Mapping class: GrantEd.DomainModel.Code.SectorCode -> SectorCode
2007-07-17 10:18:26,964#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: Id -> SectorCodeId, type: Int32
2007-07-17 10:18:26,964#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: name -> Name, type: String
2007-07-17 10:18:26,964#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: description -> Description, type: String
2007-07-17 10:18:26,964#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: active -> Active, type: Boolean
2007-07-17 10:18:26,964#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: ActionDate -> CreatedActionDate, type: DateTime
2007-07-17 10:18:26,964#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: ActionUser -> CreatedActionUser, type: String
2007-07-17 10:18:26,964#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: Created -> CreatedActionDate, CreatedActionUser, type: Audit
2007-07-17 10:18:26,964#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: ActionDate -> LastUpdatedActionDate, type: DateTime
2007-07-17 10:18:26,964#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: ActionUser -> LastUpdatedActionUser, type: String
2007-07-17 10:18:26,964#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: LastUpdated -> LastUpdatedActionDate, LastUpdatedActionUser, type: Audit
2007-07-17 10:18:26,964#[6]#INFO #NHibernate.Cfg.Configuration#[(null)]# Adding embedded mapping document: GrantEd.DomainModel.Code.NHibernate_Mapping.RuleTypeCode.hbm.xml
2007-07-17 10:18:26,964#[6]#INFO #NHibernate.Cfg.Configuration#[(null)]# Mapping resource: GrantEd.DomainModel.Code.NHibernate_Mapping.RuleTypeCode.hbm.xml
2007-07-17 10:18:26,964#[6]#INFO #NHibernate.Dialect.Dialect#[(null)]# Using dialect: NHibernate.Dialect.MsSql2005Dialect
2007-07-17 10:18:26,964#[6]#INFO #NHibernate.Cfg.HbmBinder#[(null)]# Mapping class: GrantEd.DomainModel.Code.RuleTypeCode -> RuleTypeCode
2007-07-17 10:18:26,964#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: Id -> RuleTypeCodeId, type: Int32
2007-07-17 10:18:26,964#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: name -> Name, type: String
2007-07-17 10:18:26,964#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: description -> Description, type: String
2007-07-17 10:18:26,964#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: active -> Active, type: Boolean
2007-07-17 10:18:26,964#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: ActionDate -> CreatedActionDate, type: DateTime
2007-07-17 10:18:26,964#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: ActionUser -> CreatedActionUser, type: String
2007-07-17 10:18:26,964#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: Created -> CreatedActionDate, CreatedActionUser, type: Audit
2007-07-17 10:18:26,964#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: ActionDate -> LastUpdatedActionDate, type: DateTime
2007-07-17 10:18:26,964#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: ActionUser -> LastUpdatedActionUser, type: String
2007-07-17 10:18:26,964#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: LastUpdated -> LastUpdatedActionDate, LastUpdatedActionUser, type: Audit
2007-07-17 10:18:26,964#[6]#INFO #NHibernate.Cfg.Configuration#[(null)]# Adding embedded mapping document: GrantEd.DomainModel.Code.NHibernate_Mapping.RoleTypeCode.hbm.xml
2007-07-17 10:18:26,964#[6]#INFO #NHibernate.Cfg.Configuration#[(null)]# Mapping resource: GrantEd.DomainModel.Code.NHibernate_Mapping.RoleTypeCode.hbm.xml
2007-07-17 10:18:26,964#[6]#INFO #NHibernate.Dialect.Dialect#[(null)]# Using dialect: NHibernate.Dialect.MsSql2005Dialect
2007-07-17 10:18:26,980#[6]#INFO #NHibernate.Cfg.HbmBinder#[(null)]# Mapping class: GrantEd.DomainModel.Code.RoleTypeCode -> RoleTypeCode
2007-07-17 10:18:26,980#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: Id -> RoleTypeCodeId, type: Int32
2007-07-17 10:18:26,980#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: name -> Name, type: String
2007-07-17 10:18:26,980#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: description -> Description, type: String
2007-07-17 10:18:26,980#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: active -> Active, type: Boolean
2007-07-17 10:18:26,980#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: ActionDate -> CreatedActionDate, type: DateTime
2007-07-17 10:18:26,980#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: ActionUser -> CreatedActionUser, type: String
2007-07-17 10:18:26,980#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: Created -> CreatedActionDate, CreatedActionUser, type: Audit
2007-07-17 10:18:26,980#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: ActionDate -> LastUpdatedActionDate, type: DateTime
2007-07-17 10:18:26,980#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: ActionUser -> LastUpdatedActionUser, type: String
2007-07-17 10:18:26,980#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: LastUpdated -> LastUpdatedActionDate, LastUpdatedActionUser, type: Audit
2007-07-17 10:18:26,980#[6]#INFO #NHibernate.Cfg.Configuration#[(null)]# Adding embedded mapping document: GrantEd.DomainModel.Code.NHibernate_Mapping.FundingLimitCode.hbm.xml
2007-07-17 10:18:26,980#[6]#INFO #NHibernate.Cfg.Configuration#[(null)]# Mapping resource: GrantEd.DomainModel.Code.NHibernate_Mapping.FundingLimitCode.hbm.xml
2007-07-17 10:18:26,980#[6]#INFO #NHibernate.Dialect.Dialect#[(null)]# Using dialect: NHibernate.Dialect.MsSql2005Dialect
2007-07-17 10:18:26,980#[6]#INFO #NHibernate.Cfg.HbmBinder#[(null)]# Mapping class: GrantEd.DomainModel.Code.FundingLimitCode -> FundingLimitCode
2007-07-17 10:18:26,980#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: Id -> FundingLimitCodeId, type: Int32
2007-07-17 10:18:26,980#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: name -> Name, type: String
2007-07-17 10:18:26,980#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: description -> Description, type: String
2007-07-17 10:18:26,980#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: active -> Active, type: Boolean
2007-07-17 10:18:26,980#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: ActionDate -> CreatedActionDate, type: DateTime
2007-07-17 10:18:26,980#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: ActionUser -> CreatedActionUser, type: String
2007-07-17 10:18:26,980#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: Created -> CreatedActionDate, CreatedActionUser, type: Audit
2007-07-17 10:18:26,980#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: ActionDate -> LastUpdatedActionDate, type: DateTime
2007-07-17 10:18:26,980#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: ActionUser -> LastUpdatedActionUser, type: String
2007-07-17 10:18:26,980#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: LastUpdated -> LastUpdatedActionDate, LastUpdatedActionUser, type: Audit
2007-07-17 10:18:26,980#[6]#INFO #NHibernate.Cfg.Configuration#[(null)]# Adding embedded mapping document: GrantEd.DomainModel.Code.NHibernate_Mapping.FundingTypeCode.hbm.xml
2007-07-17 10:18:26,980#[6]#INFO #NHibernate.Cfg.Configuration#[(null)]# Mapping resource: GrantEd.DomainModel.Code.NHibernate_Mapping.FundingTypeCode.hbm.xml
2007-07-17 10:18:26,980#[6]#INFO #NHibernate.Dialect.Dialect#[(null)]# Using dialect: NHibernate.Dialect.MsSql2005Dialect
2007-07-17 10:18:26,980#[6]#INFO #NHibernate.Cfg.HbmBinder#[(null)]# Mapping class: GrantEd.DomainModel.Code.FundingTypeCode -> FundingTypeCode
2007-07-17 10:18:26,980#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: Id -> FundingTypeCodeId, type: Int32
2007-07-17 10:18:26,980#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: name -> Name, type: String
2007-07-17 10:18:26,980#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: description -> Description, type: String
2007-07-17 10:18:26,980#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: active -> Active, type: Boolean
2007-07-17 10:18:26,980#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: ActionDate -> CreatedActionDate, type: DateTime
2007-07-17 10:18:26,980#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: ActionUser -> CreatedActionUser, type: String
2007-07-17 10:18:26,980#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: Created -> CreatedActionDate, CreatedActionUser, type: Audit
2007-07-17 10:18:26,980#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: ActionDate -> LastUpdatedActionDate, type: DateTime
2007-07-17 10:18:26,980#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: ActionUser -> LastUpdatedActionUser, type: String
2007-07-17 10:18:26,995#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: LastUpdated -> LastUpdatedActionDate, LastUpdatedActionUser, type: Audit
2007-07-17 10:18:26,995#[6]#INFO #NHibernate.Cfg.Configuration#[(null)]# Adding embedded mapping document: GrantEd.DomainModel.Code.NHibernate_Mapping.ClientTypeCode.hbm.xml
2007-07-17 10:18:26,995#[6]#INFO #NHibernate.Cfg.Configuration#[(null)]# Mapping resource: GrantEd.DomainModel.Code.NHibernate_Mapping.ClientTypeCode.hbm.xml
2007-07-17 10:18:26,995#[6]#INFO #NHibernate.Dialect.Dialect#[(null)]# Using dialect: NHibernate.Dialect.MsSql2005Dialect
2007-07-17 10:18:26,995#[6]#INFO #NHibernate.Cfg.HbmBinder#[(null)]# Mapping class: GrantEd.DomainModel.Code.ClientTypeCode -> ClientTypeCode
2007-07-17 10:18:26,995#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: Id -> ClientTypeId, type: Int32
2007-07-17 10:18:26,995#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: name -> Name, type: String
2007-07-17 10:18:26,995#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: description -> Description, type: String
2007-07-17 10:18:26,995#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: active -> Active, type: Boolean
2007-07-17 10:18:26,995#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: ActionDate -> CreatedActionDate, type: DateTime
2007-07-17 10:18:26,995#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: ActionUser -> CreatedActionUser, type: String
2007-07-17 10:18:26,995#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: Created -> CreatedActionDate, CreatedActionUser, type: Audit
2007-07-17 10:18:26,995#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: ActionDate -> LastUpdatedActionDate, type: DateTime
2007-07-17 10:18:26,995#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: ActionUser -> LastUpdatedActionUser, type: String
2007-07-17 10:18:26,995#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: LastUpdated -> LastUpdatedActionDate, LastUpdatedActionUser, type: Audit
2007-07-17 10:18:26,995#[6]#INFO #NHibernate.Cfg.Configuration#[(null)]# Searching for mapped documents in assembly: GrantEd.DomainModel.ProgrammeMgmt
2007-07-17 10:18:27,011#[6]#INFO #NHibernate.Cfg.Configuration#[(null)]# Adding embedded mapping document: GrantEd.DomainModel.ProgrammeMgmt.NHibernate_Mapping.PostingAccountCalculatorRegistry.hbm.xml
2007-07-17 10:18:27,011#[6]#INFO #NHibernate.Cfg.Configuration#[(null)]# Mapping resource: GrantEd.DomainModel.ProgrammeMgmt.NHibernate_Mapping.PostingAccountCalculatorRegistry.hbm.xml
2007-07-17 10:18:27,011#[6]#INFO #NHibernate.Dialect.Dialect#[(null)]# Using dialect: NHibernate.Dialect.MsSql2005Dialect
2007-07-17 10:18:27,011#[6]#INFO #NHibernate.Cfg.HbmBinder#[(null)]# Mapping class: GrantEd.DomainModel.ProgrammeMgmt.PostingAccountCalculatorRegistry -> PostingAccountCalculatorRegistry
2007-07-17 10:18:27,011#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: id -> PostingAccountCalculatorRegistryId, type: Int32
2007-07-17 10:18:27,011#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: ActionDate -> CreatedActionDate, type: DateTime
2007-07-17 10:18:27,011#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: ActionUser -> CreatedActionUser, type: String
2007-07-17 10:18:27,011#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: Created -> CreatedActionDate, CreatedActionUser, type: Audit
2007-07-17 10:18:27,011#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: ActionDate -> LastUpdatedActionDate, type: DateTime
2007-07-17 10:18:27,011#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: ActionUser -> LastUpdatedActionUser, type: String
2007-07-17 10:18:27,011#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: LastUpdated -> LastUpdatedActionDate, LastUpdatedActionUser, type: Audit
2007-07-17 10:18:27,011#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: CalculatorName -> CalculatorName, type: String
2007-07-17 10:18:27,011#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: Description -> Description, type: String
2007-07-17 10:18:27,011#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: SupportingDocumentURL -> SupportingDocumentURL, type: String
2007-07-17 10:18:27,011#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: Active -> Active, type: Boolean
2007-07-17 10:18:27,011#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: Timestamp -> Timestamp, type: Byte[]
2007-07-17 10:18:27,058#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: _postingCalculatorIdProgrammeRounds, type: DomainCollectionBase`2
2007-07-17 10:18:27,058#[6]#INFO #NHibernate.Cfg.Configuration#[(null)]# Adding embedded mapping document: GrantEd.DomainModel.ProgrammeMgmt.NHibernate_Mapping.TestDetail.hbm.xml
2007-07-17 10:18:27,058#[6]#INFO #NHibernate.Cfg.Configuration#[(null)]# Mapping resource: GrantEd.DomainModel.ProgrammeMgmt.NHibernate_Mapping.TestDetail.hbm.xml
2007-07-17 10:18:27,058#[6]#INFO #NHibernate.Dialect.Dialect#[(null)]# Using dialect: NHibernate.Dialect.MsSql2005Dialect
2007-07-17 10:18:27,058#[6]#INFO #NHibernate.Cfg.HbmBinder#[(null)]# Mapping class: GrantEd.DomainModel.ProgrammeMgmt.TestDetail -> TestDetail
2007-07-17 10:18:27,058#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: id -> TestDetailId, type: Int32
2007-07-17 10:18:27,058#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: Name -> Name, type: String
2007-07-17 10:18:27,073#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: TestMaster -> TestMasterId, type: TestMaster
2007-07-17 10:18:27,073#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: Id -> StateCd, type: Int32
2007-07-17 10:18:27,073#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: StateCd -> StateCd, type: StateCode
2007-07-17 10:18:27,073#[6]#INFO #NHibernate.Cfg.Configuration#[(null)]# Adding embedded mapping document: GrantEd.DomainModel.ProgrammeMgmt.NHibernate_Mapping.PostingAccount.hbm.xml
2007-07-17 10:18:27,073#[6]#INFO #NHibernate.Cfg.Configuration#[(null)]# Mapping resource: GrantEd.DomainModel.ProgrammeMgmt.NHibernate_Mapping.PostingAccount.hbm.xml
2007-07-17 10:18:27,073#[6]#INFO #NHibernate.Dialect.Dialect#[(null)]# Using dialect: NHibernate.Dialect.MsSql2005Dialect
2007-07-17 10:18:27,073#[6]#INFO #NHibernate.Cfg.HbmBinder#[(null)]# Mapping class: GrantEd.DomainModel.ProgrammeMgmt.PostingAccount -> PostingAccount
2007-07-17 10:18:27,073#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: id -> PostingAccountId, type: Int32
2007-07-17 10:18:27,073#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: ActionDate -> CreatedActionDate, type: DateTime
2007-07-17 10:18:27,073#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: ActionUser -> CreatedActionUser, type: String
2007-07-17 10:18:27,073#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: Created -> CreatedActionDate, CreatedActionUser, type: Audit
2007-07-17 10:18:27,073#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: ActionDate -> LastUpdatedActionDate, type: DateTime
2007-07-17 10:18:27,073#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: ActionUser -> LastUpdatedActionUser, type: String
2007-07-17 10:18:27,073#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: LastUpdated -> LastUpdatedActionDate, LastUpdatedActionUser, type: Audit
2007-07-17 10:18:27,073#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: CostCentre -> CostCentre, type: String
2007-07-17 10:18:27,073#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: Active -> Active, type: Boolean
2007-07-17 10:18:27,073#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: Timestamp -> Timestamp, type: Byte[]
2007-07-17 10:18:27,073#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: ExpenseAccountId -> ExpenseAccountId, type: GLAccount
2007-07-17 10:18:27,073#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: LiabilityAccountId -> LiabilityAccountId, type: GLAccount
2007-07-17 10:18:27,073#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: _clientPostingAccounts, type: DomainCollectionBase`2
2007-07-17 10:18:27,073#[6]#INFO #NHibernate.Cfg.Configuration#[(null)]# Adding embedded mapping document: GrantEd.DomainModel.ProgrammeMgmt.NHibernate_Mapping.EntitlementCalculatorRegistration.hbm.xml
2007-07-17 10:18:27,073#[6]#INFO #NHibernate.Cfg.Configuration#[(null)]# Mapping resource: GrantEd.DomainModel.ProgrammeMgmt.NHibernate_Mapping.EntitlementCalculatorRegistration.hbm.xml
2007-07-17 10:18:27,073#[6]#INFO #NHibernate.Dialect.Dialect#[(null)]# Using dialect: NHibernate.Dialect.MsSql2005Dialect
2007-07-17 10:18:27,073#[6]#INFO #NHibernate.Cfg.HbmBinder#[(null)]# Mapping class: GrantEd.DomainModel.ProgrammeMgmt.EntitlementCalculatorRegistration -> EntitlementCalculatorRegistration
2007-07-17 10:18:27,073#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: id -> EntitlementCalculatorRegistrationId, type: Int32
2007-07-17 10:18:27,073#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: ActionDate -> CreatedActionDate, type: DateTime
2007-07-17 10:18:27,073#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: ActionUser -> CreatedActionUser, type: String
2007-07-17 10:18:27,073#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: Created -> CreatedActionDate, CreatedActionUser, type: Audit
2007-07-17 10:18:27,073#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: ActionDate -> LastUpdatedActionDate, type: DateTime
2007-07-17 10:18:27,073#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: ActionUser -> LastUpdatedActionUser, type: String
2007-07-17 10:18:27,073#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: LastUpdated -> LastUpdatedActionDate, LastUpdatedActionUser, type: Audit
2007-07-17 10:18:27,073#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: CalculatorName -> CalculatorName, type: String
2007-07-17 10:18:27,073#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: Description -> Description, type: String
2007-07-17 10:18:27,073#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: SupportingDocumentURL -> SupportingDocumentURL, type: String
2007-07-17 10:18:27,073#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: Timestamp -> Timestamp, type: Byte[]
2007-07-17 10:18:27,073#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: _entitlementCalculatorIdProgrammeRounds, type: DomainCollectionBase`2
2007-07-17 10:18:27,073#[6]#INFO #NHibernate.Cfg.Configuration#[(null)]# Adding embedded mapping document: GrantEd.DomainModel.ProgrammeMgmt.NHibernate_Mapping.ClientPostingAccount.hbm.xml
2007-07-17 10:18:27,073#[6]#INFO #NHibernate.Cfg.Configuration#[(null)]# Mapping resource: GrantEd.DomainModel.ProgrammeMgmt.NHibernate_Mapping.ClientPostingAccount.hbm.xml
2007-07-17 10:18:27,073#[6]#INFO #NHibernate.Dialect.Dialect#[(null)]# Using dialect: NHibernate.Dialect.MsSql2005Dialect
2007-07-17 10:18:27,073#[6]#INFO #NHibernate.Cfg.HbmBinder#[(null)]# Mapping class: GrantEd.DomainModel.ProgrammeMgmt.ClientPostingAccount -> ClientPostingAccount
2007-07-17 10:18:27,073#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: id -> ClientPostingAccountId, type: Int32
2007-07-17 10:18:27,073#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: ActionDate -> CreatedActionDate, type: DateTime
2007-07-17 10:18:27,073#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: ActionUser -> CreatedActionUser, type: String
2007-07-17 10:18:27,073#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: Created -> CreatedActionDate, CreatedActionUser, type: Audit
2007-07-17 10:18:27,073#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: ActionDate -> LastUpdatedActionDate, type: DateTime
2007-07-17 10:18:27,073#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: ActionUser -> LastUpdatedActionUser, type: String
2007-07-17 10:18:27,073#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: LastUpdated -> LastUpdatedActionDate, LastUpdatedActionUser, type: Audit
2007-07-17 10:18:27,073#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: Active -> Active, type: Boolean
2007-07-17 10:18:27,073#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: Timestamp -> Timestamp, type: Byte[]
2007-07-17 10:18:27,073#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: ProgrammeRound -> ProgrammeRoundId, type: ProgrammeRound
2007-07-17 10:18:27,073#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: Id -> StateCd, type: Int32
2007-07-17 10:18:27,073#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: StateCd -> StateCd, type: StateCode
2007-07-17 10:18:27,073#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: PostingAccount -> PostingAccountId, type: PostingAccount
2007-07-17 10:18:27,073#[6]#INFO #NHibernate.Cfg.HbmBinder#[(null)]# Mapping collection: GrantEd.DomainModel.ProgrammeMgmt.ClientPostingAccount._clientTypeCodes -> ClientPostingAccountClientTypeCode
2007-07-17 10:18:27,089#[6]#DEBUG#NHibernate.Cfg.HbmBinder#[(null)]# Mapped property: _clientTypeCodes, type: DomainCollectionBase`2
2007-07-17 10:18:27,089#[6]#INFO #NHibernate.Cfg.HbmBinder#[(null)]# Mapping collection: GrantEd.DomainModel.ProgrammeMgmt.ClientPostingAccount.Clients -> ClientPostingAccountClient
2007-07-17 10:18:27,089#[6]#ERROR#NHibernate.Cfg.Configuration#[(null)]# Could not compile the mapping document: GrantEd.DomainModel.ProgrammeMgmt.NHibernate_Mapping.ClientPostingAccount.hbm.xml
NHibernate.MappingException: Could not compile the mapping document: GrantEd.DomainModel.ProgrammeMgmt.NHibernate_Mapping.ClientPostingAccount.hbm.xml ---> NHibernate.MappingException: Error mapping generic collection GrantEd.DomainModel.ProgrammeMgmt.ClientPostingAccount.Clients: expected 1 generic parameters, but the property type has 2
   at NHibernate.Mapping.Collection.CheckGenericArgumentsLength(Int32 expectedLength)
   at NHibernate.Mapping.Set.get_DefaultCollectionType()
   at NHibernate.Mapping.Collection.get_CollectionType()
   at NHibernate.Mapping.Collection.get_Type()
   at NHibernate.Cfg.HbmBinder.BindProperty(XmlNode node, Property property, Mappings mappings)
   at NHibernate.Cfg.HbmBinder.CreateProperty(IValue value, String propertyName, Type parentClass, XmlNode subnode, Mappings mappings)
   at NHibernate.Cfg.HbmBinder.PropertiesFromXML(XmlNode node, PersistentClass model, Mappings mappings)
   at NHibernate.Cfg.HbmBinder.BindRootClass(XmlNode node, RootClass model, Mappings mappings)
   at NHibernate.Cfg.HbmBinder.BindRoot(XmlDocument doc, Mappings mappings)
   at NHibernate.Cfg.Configuration.AddValidatedDocument(XmlDocument doc, String name)
   --- End of inner exception stack trace ---
[/list][/quote]


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 17, 2007 1:04 am 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
Where are you specifying the custom type for the clients collection?

Also, don't do those tricks in the property getter or you'll get your collection elements deleted. Switch to access="field.something" if you need those tricks.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 18, 2007 5:42 am 
Newbie

Joined: Mon Jul 16, 2007 2:25 am
Posts: 7
Thanks for your reply.

I have added the collection type attribute, and the mapping looks like this now.

Code:
<set name="Clients"  collection-type="GrantEd.DomainModel.ClientMgmt.Clients`2[[GrantEd.ClientMgmt.Client],[System.Int32]], GrantEd.DomainModel.ClientMgmt" table="ClientPostingAccountClient" access="property" lazy="false">
         <key column="ClientPostingAccountId"/>
         <composite-element class="GrantEd.DomainModel.ClientMgmt.Clients`2[[GrantEd.ClientMgmt.Client],[System.Int32]], GrantEd.DomainModel.Core">
            <property name="id" type="int"/>
         </composite-element>
      </set>


The exception i get now is Could not load file or assembly GrantEd.DomainModel.Clientmgmt.

The nHibernate log is
Code:
2007-07-18 19:32:02,389#[5]#ERROR#NHibernate.Util.ReflectHelper#[(null)]# Could not load type GrantEd.DomainModel.ClientMgmt.Clients`2[[GrantEd.ClientMgmt.Client],[System.Int32]], GrantEd.DomainModel.ClientMgmt.
System.IO.FileNotFoundException: Could not load file or assembly 'GrantEd.DomainModel.ClientMgmt' or one of its dependencies. The system cannot find the file specified.
File name: 'GrantEd.DomainModel.ClientMgmt'
   at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
   at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
   at System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
   at System.Reflection.Assembly.Load(String assemblyString)
   at NHibernate.Util.ReflectHelper.TypeFromAssembly(AssemblyQualifiedTypeName name, Boolean throwOnError) in C:\Program Files\NHibernate12GA\NHibernate-src\src\NHibernate\Util\ReflectHelper.cs:line 199

=== Pre-bind state information ===
LOG: User = portfolio\serviceSEMIS
LOG: DisplayName = GrantEd.DomainModel.ClientMgmt
(Partial)
LOG: Appbase = file:///C:/UserData/SEMISPT/ServerExecute/
LOG: Initial PrivatePath = NULL
Calling assembly : NHibernate, Version=1.2.0.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4.


This puzzles me as the assembly is in the directory. I'm trying to step through the nHibnernate source and the property collectiontype is showing this exception. Will continue to debug unless there is something Im not doing correctly.

To clarify, is my assumtpion that nHibernate does not need the assembly to be loaded to allow it to create an instance of the class is correct?

As far as the second point I would like to clarify some behaviour once I have resolved the exception.


Thanks
Peter


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 20, 2007 9:31 am 
Newbie

Joined: Mon Jul 16, 2007 2:25 am
Posts: 7
Sergey,

thanks for the tip on the collection-type. Up and running.

Some background regarding the code in the collection property.

The project i am working on is developing a WinFormss application, using WCF to communicate with the application server. Classes are serialised between the client and server. For this reason we lazy load properties that are collections. The server code loads the classes with the nHibernate factory instance cached and a session created for each request. To avoid an exception when nhibernate tries to load the lazy loaded collections we decided to return null if the collection has not been initalised. Originally, we did not want to deploy nHibernate to the client, but could not find a way around the fact nHibernate injects a proxy which cause deserialisation errors because nHibernate was not on the client.

A nice feature would be to introduce a mapping atttribute to indicate the collection is not to be loaded and lazy loading is not required.

To correct the issue with code, I will return null rather than set the private variable to null.

Cheers
Peter


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.