2011-08-29 55 views
1
<?xml version="1.0" encoding="utf-8"?> 
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"> 

    <class name="CITI.manageID.Data.Entities.AuthUserKioskRoleMap,CITI.manageID.Data" table="AuthUserKioskRoleMap" lazy="false"> 
    <composite-id name="Id" class="CITI.manageID.Data.Entities.AuthUserKioskRoleMapId,CITI.manageID.Data"> 
     <key-many-to-one name="AuthUsers" class="CITI.manageID.Data.Entities.AuthUsers,CITI.manageID.Data" column="UserID" /> 
     <key-many-to-one name="KioskInfo" class="CITI.manageID.Data.Entities.KioskInfo,CITI.manageID.Data" column="KioskID" /> 
     <key-many-to-one name="AuthRole" class="CITI.manageID.Data.Entities.AuthRole,CITI.manageID.Data" column="Roleid" /> 
    </composite-id> 
    <property name="Status" column="Status" type="string" /> 
    <property name="CreatedBy" column="CreatedBy" type="string" not-null="true" /> 
    <property name="CreatedOn" column="CreatedOn" type="DateTime" not-null="true" /> 
    <property name="UpdatedBy" column="UpdatedBy" type="string" /> 
    <property name="UpdatedOn" column="UpdatedOn" type="DateTime" /> 
    <many-to-one name="AuthRole" column="Roleid" cascade="save-update" not-null="true" /> 
    <many-to-one name="AuthUsers" column="UserID" cascade="save-update" not-null="true" /> 
    <many-to-one name="KioskInfo" column="KioskID" cascade="save-update" not-null="true" /> 
    </class> 
</hibernate-mapping> 

我試過以下我無法從這個NHibernate映射中獲取記錄

ICriteria crit = SessionRepository.CreateRepositoryCriteria(typeof(AuthUserKioskRoleMap)); 
crit.Add(Expression.InsensitiveLike("AuthUsers.Userid", AuthUserID)); 
crit.Add(Expression.InsensitiveLike("KioskInfo.Kioskid", KioskID)); 
crit.Add(Expression.InsensitiveLike("Id.AuthUsers.Status", "A")); 
crit.Add(Expression.InsensitiveLike("Id.KioskInfo.Status", "A")); 
crit.Add(Expression.InsensitiveLike("Id.AuthRole.Status ", "A")); 
crit.Add(Expression.InsensitiveLike("Status", "A")); 
crit.AddOrder(new Order("ImageType", true)); 

ApplicantFaceInfoList = crit.List<AuthUserKioskRoleMap>(); 

請幫助

+6

如果你**能夠獲取**的數據 - 這是什麼問題?你的問題是什麼? –

+1

我懷疑標題應該是「我不能......」我投票重新打開。 IMO S.O.用戶有時會快速判斷。 – Rippo

+0

@sanjay - 標題應該是「我無法獲取數據..」嗎? – Rippo

回答

0

被稱爲AuthUserKioskRoleMap.hbm.xml這個映射文件,並設置爲在可視的嵌入對象工作室?

請注意hbm.xml擴展,因爲這很重要。

如果仍然無法使用,請提供更多信息,例如:任何錯誤和/或配置代碼。