NHibernate中外联接的一个错误..明白的指点一下!!!
代码:
Dim strHql As String = "select a.LANGUAGE_ID,a.LANGUAGE_NAME,b.LANGUAGE_LEVEL,a.TYPE_FLG from LANGUAGE a left outer join USER_LANGUAGE b on b.USER_ID = '" & _strUserId & "' and a.LANGUAGE_ID = b.LANGUAGE_ID "
' 员工基本信息的取得
lstUserLan = dbSession.CreateQuery(strHql).List
异常:
ex {"outer or full join must be followed by path expression [from Dmax.Core.LANGUAGE a left outer join USER_LANGUAGE b on b.USER_ID = '000003' and a.LANGUAGE_ID = b.LANGUAGE_ID ]"} System.Exception
- NHibernate.QueryException {"outer or full join must be followed by path expression [from Dmax.Core.LANGUAGE a left outer join USER_LANGUAGE b on b.USER_ID = '000003' and a.LANGUAGE_ID = b.LANGUAGE_ID ]"} NHibernate.QueryException
- Data {System.Collections.ListDictionaryInternal} System.Collections.IDictionary
- System.Collections.ListDictionaryInternal {System.Collections.ListDictionaryInternal} System.Collections.ListDictionaryInternal
Count 0 Integer
IsFixedSize False Boolean
IsReadOnly False Boolean
IsSynchronized False Boolean
Item インデックス付きのプロパティを評価するためには、プロパティが限定されていて、ユーザーにより引数が明示的に指定されていなければなりません。 Object
+ Keys {System.Collections.ListDictionaryInternal.NodeKeyValueCollection} System.Collections.ICollection
SyncRoot {Object} Object
+ Values {System.Collections.ListDictionaryInternal.NodeKeyValueCollection} System.Collections.ICollection
IsFixedSize False Boolean
IsReadOnly False Boolean
Item インデックス付きのプロパティを評価するためには、プロパティが限定されていて、ユーザーにより引数が明示的に指定されていなければなりません。 Object
+ Keys {System.Collections.ListDictionaryInternal.NodeKeyValueCollection} System.Collections.ICollection
+ Values {System.Collections.ListDictionaryInternal.NodeKeyValueCollection} System.Collections.ICollection
HelpLink Nothing String
InnerException Nothing System.Exception
Message "outer or full join must be followed by path expression [from Dmax.Core.LANGUAGE a left outer join USER_LANGUAGE b on b.USER_ID = '000003' and a.LANGUAGE_ID = b.LANGUAGE_ID ]" String
QueryString "from Dmax.Core.LANGUAGE a left outer join USER_LANGUAGE b on b.USER_ID = '000003' and a.LANGUAGE_ID = b.LANGUAGE_ID " String
Source "NHibernate" String
StackTrace " 場所 NHibernate.Hql.Classic.FromParser.Token(String token, QueryTranslator q)
場所 NHibernate.Hql.Classic.ClauseParser.Token(String token, QueryTranslator q)
場所 NHibernate.Hql.Classic.PreprocessingParser.Token(String token, QueryTranslator q)
場所 NHibernate.Hql.Classic.ParserHelper.Parse(IParser p, String text, String seperators, QueryTranslator q)
場所 NHibernate.Hql.Classic.QueryTranslator.Compile()
場所 NHibernate.Hql.Classic.QueryTranslator.Compile(IDictionary replacements, Boolean scalar)
場所 NHibernate.Impl.SessionFactoryImpl.GetQuery(String queryString, Boolean shallow, IDictionary enabledFilters)
場所 NHibernate.Impl.SessionImpl.GetQueries(String query, Boolean scalar)
場所 NHibernate.Impl.SessionImpl.Find(String query, QueryParameters parameters, IList results)
場所 NHibernate.Impl.SessionImpl.Find(String query, QueryParameters parameters)
場所 NHibernate.Impl.QueryImpl.List()
場所 Dmax.Util.OutputSkillHisExcFile.SetLangItemStatus(String strUserId, Worksheet& objWorkSheet) 場所 D:Dmax\Dmax.Util\OutputSkillHisExcFile.vb:行 178" String
+ TargetSite {System.Reflection.RuntimeMethodInfo} System.Reflection.MethodBase
+ Data {System.Collections.ListDictionaryInternal} System.Collections.IDictionary
HelpLink Nothing String
InnerException Nothing System.Exception
Message "outer or full join must be followed by path expression [from Dmax.Core.LANGUAGE a left outer join USER_LANGUAGE b on b.USER_ID = '000003' and a.LANGUAGE_ID = b.LANGUAGE_ID ]" String
Source "NHibernate" String
StackTrace " 場所 NHibernate.Hql.Classic.FromParser.Token(String token, QueryTranslator q)
場所 NHibernate.Hql.Classic.ClauseParser.Token(String token, QueryTranslator q)
場所 NHibernate.Hql.Classic.PreprocessingParser.Token(String token, QueryTranslator q)
場所 NHibernate.Hql.Classic.ParserHelper.Parse(IParser p, String text, String seperators, QueryTranslator q)
場所 NHibernate.Hql.Classic.QueryTranslator.Compile()
場所 NHibernate.Hql.Classic.QueryTranslator.Compile(IDictionary replacements, Boolean scalar)
場所 NHibernate.Impl.SessionFactoryImpl.GetQuery(String queryString, Boolean shallow, IDictionary enabledFilters)
場所 NHibernate.Impl.SessionImpl.GetQueries(String query, Boolean scalar)
場所 NHibernate.Impl.SessionImpl.Find(String query, QueryParameters parameters, IList results)
場所 NHibernate.Impl.SessionImpl.Find(String query, QueryParameters parameters)
場所 NHibernate.Impl.QueryImpl.List()
場所 Dmax.Util.OutputSkillHisExcFile.SetLangItemStatus(String strUserId, Worksheet& objWorkSheet) 場所 D:\Dmax\Dmax.Util\OutputSkillHisExcFile.vb:行 178" String
+ TargetSite {System.Reflection.RuntimeMethodInfo} System.Reflection.MethodBase
哎..NHibernate这东东用起来真费事....高手们救命呀...
外联时需要对XML文件进行什么特别的设定吗?
[解决办法]
建议用ibatisnet
[解决办法]
uip
[解决办法]
select a.LANGUAGE_ID,a.LANGUAGE_NAME,b.LANGUAGE_LEVEL,a.TYPE_FLG from LANGUAGE a left join fetch USER_LANGUAGE b on a.LANGUAGE_ID = b.LANGUAGE_ID where b.USER_ID = '" & _strUserId & "'