以下の取得:NHibernateはLINQの
NHibernate.Exceptions.GenericADOException occurred
Message=could not execute query
[ select personuser0_.USER_ID as col_0_0_, personuser0_.USER_FIRSTNAME as col_1_0_, personuser0_.USER_SURNAME as col_2_0_, (select personrole2_.ROLE_ID, personrole2_.ROLE_NAME from PERSON_ROLE_USER roles1_, PERSON_ROLE personrole2_ where personuser0_.USER_ID=roles1_.USER_ID and roles1_.ROLE_ID=personrole2_.ROLE_ID) as col_3_0_ from PERSON_USER personuser0_ ]
[SQL: select personuser0_.USER_ID as col_0_0_, personuser0_.USER_FIRSTNAME as col_1_0_, personuser0_.USER_SURNAME as col_2_0_, (select personrole2_.ROLE_ID, personrole2_.ROLE_NAME from PERSON_ROLE_USER roles1_, PERSON_ROLE personrole2_ where personuser0_.USER_ID=roles1_.USER_ID and roles1_.ROLE_ID=personrole2_.ROLE_ID) as col_3_0_ from PERSON_USER personuser0_]
Source=NHibernate
SqlString=select personuser0_.USER_ID as col_0_0_, personuser0_.USER_FIRSTNAME as col_1_0_, personuser0_.USER_SURNAME as col_2_0_, (select personrole2_.ROLE_ID, personrole2_.ROLE_NAME from PERSON_ROLE_USER roles1_, PERSON_ROLE personrole2_ where personuser0_.USER_ID=roles1_.USER_ID and roles1_.ROLE_ID=personrole2_.ROLE_ID) as col_3_0_ from PERSON_USER personuser0_
InnerException: System.Data.SqlClient.SqlException
Message=Only one expression can be specified in the select list when the subquery is not introduced with EXISTS.
Source=.Net SqlClient Data Provider
ErrorCode=-2146232060
Class=16
LineNumber=1
Number=116
Procedure=""
State=1
注:PersonUser
とPersonRole
POCOのデータベース・エンティティであり、User
とRole
はシンプルなDTOです。 PersonUser.Roles
はリストマップHasManyToManyです。
どのようにして、NHをcorectlyにプロジェクトに導くことができますUser
DTOは多対多の関係を含めてRole
DTOに出荷されますか?
大変助かりました!
NHibernateのは、今、このようなサブクエリ – hazzik
のためにサポートしていません、私は正確に同じエラー – PJUK