Dude,
Sorry, but RTFM...
The class property that are u trying to map is a COLLECTION, so you have to
map it as collection...
bag, set or list
<bag name="ItemType" table="tItem_ItemTyle" order-by="ItemType ASC">
<key column="tItemID"/>
<element column="ItemType" type="String"/>
</bag>
OR
<set name="ItemType" table="tItem_ItemType">
<key column="tItemID"/>
<element column="ItemType" type="String"/>
</set>
OR
<list name="ItemType" table="tItem_ItemType">
<key column="tItemID"/>
<index column="IndexOfList"/>
<element column="ItemType" type="String"/>
</list>
---
Fernando Zago
Arquiteto de Software
Mult-e – People, solutions and technology
http://www.mult-e.com.br/
On Tue, Dec 21, 2010 at 6:30 AM, Deepraj <[email protected]> wrote:
> HI all,
>
> I need help in this scenrio defined below.
>
> I am developing a web application and I have a class structure like
> this.
>
> namespace CS3Entities
> {
> public class ItemImp
> {
> protected const string cogran_classid = "15KD5SE6B3P0";
> public ItemImp()
> {
> this.CreatedDate = DateTime.Now;
> this.UpdatedDate = DateTime.Now;
> }
>
> public virtual string ItemID { get; set; }
>
> #region child classes
>
> public virtual CS3Entities.ItemRestrict SelectedItemRestrict
> { get; set; }
>
> public virtual ICollection<CS3Entities.ItemRestrict>
> ItemRestricts { get; set; }
>
> #endregion
>
> #region popup references
>
> public virtual ICollection<CS3Entities.Season>
> SeasonLastPrograms { get; set; }
>
> public virtual ICollection<CS3Entities.SurveyTarget>
> SurveyTargetItemIDs { get; set; }
>
> public virtual ICollection<CS3Entities.Volunteer>
> VolunteerItemIDs { get; set; }
>
> public virtual ICollection<CS3Entities.Team> TeamPrograms
> { get; set; }
>
> public virtual ICollection<CS3Entities.TeamCopyCtrl>
> TeamCopyCtrlItemIDTos { get; set; }
>
> public virtual ICollection<CS3Entities.Season>
> SeasonNewPrograms { get; set; }
>
> public virtual ICollection<CS3Entities.TeamPaymentDtl>
> TeamPaymentDtlItemIDs { get; set; }
>
> public virtual ICollection<CS3Entities.TeamCtrl>
> TeamCtrlItemIDs { get; set; }
>
> public virtual ICollection<CS3Entities.EventItem>
> EventItemItemIDs { get; set; }
>
> public virtual ICollection<CS3Entities.PaymentOption>
> PaymentOptionItemIDs { get; set; }
>
> public virtual ICollection<CS3Entities.TeamPaymentCtrl>
> TeamPaymentCtrlItemIDs { get; set; }
>
> public virtual ICollection<CS3Entities.TeamPaymentCtrl>
> TeamPaymentCtrlTeamItemIDs { get; set; }
>
> public virtual ICollection<CS3Entities.PaymentDtl>
> PaymentDtlItemIDs { get; set; }
>
> public virtual ICollection<CS3Entities.EventReg>
> EventRegItemIDs { get; set; }
>
> #endregion
>
> public virtual string League { get; set; }
>
> public virtual string MoreInfoURL { get; set; }
>
> public virtual double TaxCode { get; set; }
>
> public virtual string Description { get; set; }
>
> [NotNullNotEmpty(Message = "Required")]
> public virtual string ShortDescription { get; set; }
>
> public virtual int HouseDiscount { get; set; }
>
> public virtual double LatePaymentFee { get; set; }
>
> public virtual double HouseDiscountAmt { get; set; }
>
> public virtual bool isArchive { get; set; }
>
> public virtual double EarlyPaymentDisc { get; set; }
>
> public virtual double InstallmentDeposit { get; set; }
>
> public virtual double UnitPrice { get; set; }
>
> public virtual int QtyDiscount { get; set; }
>
> public virtual int Interval { get; set; }
>
> public virtual string Category { get; set; }
>
> public virtual int Installment { get; set; }
>
> public virtual double QtyDiscountAmt { get; set; }
>
> public virtual string ImageURL { get; set; }
>
> [NotNullNotEmpty(Message = "Required")]
> public virtual IList<string> ItemType { get; set; }
>
> public virtual string AccountCode { get; set; }
>
>
> #region auditing fields
>
> public virtual string CreatedBy { get; set; }
>
> public virtual DateTime? CreatedDate { get; set; }
>
> public virtual string UpdatedBy { get; set; }
>
> public virtual DateTime? UpdatedDate { get; set; }
>
> public virtual long TranID { get; set; }
>
> #endregion
> }
> }
>
> Here I have a property named ItemType with the following signature :
> public virtual IList<string> ItemType { get;
> set; }
>
> My mapping file is as below.
>
> <?xml version="1.0" encoding="utf-8" ?>
> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
> assembly="CS3Entities"
> namespace="CS3Entities">
>
> <class name="Item" table="tItem" batch-size="10">
> <id name="ItemID" column="ItemID">
> <generator class="assigned"></generator>
> </id>
>
> <property name="League" column="League" ></property>
>
> <property name="MoreInfoURL" column="MoreInfoURL" ></property>
>
> <property name="TaxCode" column="TaxCode" ></property>
>
> <property name="Description" column="Description" ></property>
>
> <property name="ShortDescription" column="ShortDescription" ></
> property>
>
> <property name="HouseDiscount" column="HouseDiscount" ></
> property>
>
> <property name="LatePaymentFee" column="LatePaymentFee" ></
> property>
>
> <property name="HouseDiscountAmt" column="HouseDiscountAmt" ></
> property>
>
> <property name="isArchive" column="isArchive" ></property>
>
> <property name="EarlyPaymentDisc" column="EarlyPaymentDisc" ></
> property>
>
> <property name="InstallmentDeposit" column="InstallmentDeposit"
> ></property>
>
> <property name="UnitPrice" column="UnitPrice" ></property>
>
> <property name="QtyDiscount" column="QtyDiscount" ></property>
>
> <property name="Interval" column="Interval" ></property>
>
> <property name="Category" column="Category" ></property>
>
> <property name="Installment" column="Installment" ></property>
>
> <property name="QtyDiscountAmt" column="QtyDiscountAmt" ></
> property>
>
> <property name="ImageURL" column="ImageURL" ></property>
>
> <property name="ItemType" column="ItemType"></property>
>
> <property name="AccountCode" column="AccountCode" ></property>
>
> <property name="CreatedBy" column="CreatedBy" ></property>
>
> <property name="CreatedDate" column="CreatedDate" ></property>
>
> <property name="UpdatedBy" column="UpdatedBy" ></property>
>
> <property name="UpdatedDate" column="UpdatedDate" ></property>
>
> </class>
> </hibernate-mapping>
>
> The prpoerty ItemType is mapped as
> <property name="ItemType" column="ItemType"></property>
>
> While running the application I get the following error.
>
> Could not determine type for:
> System.Collections.Generic.IList`1[[System.String, mscorlib,
> Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]],
> mscorlib, Version=2.0.0.0, Culture=neutral,
> PublicKeyToken=b77a5c561934e089, for columns:
> NHibernate.Mapping.Column(ItemType)
>
> Please provide your views.
>
> Thanks in advance.
>
> Regards,
> Deepraj D
>
> --
> 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]<nhusers%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/nhusers?hl=en.
>
>
--
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.