本文整理汇总了C#中NHibernate.Engine.JoinSequence.ToJoinFragment方法的典型用法代码示例。如果您正苦于以下问题:C# JoinSequence.ToJoinFragment方法的具体用法?C# JoinSequence.ToJoinFragment怎么用?C# JoinSequence.ToJoinFragment使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NHibernate.Engine.JoinSequence
的用法示例。
在下文中一共展示了JoinSequence.ToJoinFragment方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateCollectionSubquery
public static string CreateCollectionSubquery(
JoinSequence joinSequence,
IDictionary enabledFilters,
String[] columns)
{
try
{
JoinFragment join = joinSequence.ToJoinFragment(enabledFilters, true);
return new StringBuilder()
.Append("select ")
.Append(StringHelper.Join(", ", columns))
.Append(" from ")
.Append(join.ToFromFragmentString.Substring(2)) // remove initial ", "
.Append(" where ")
.Append(join.ToWhereFragmentString.Substring(5)) // remove initial " and "
.ToString();
}
catch (MappingException me)
{
throw new QueryException(me);
}
}
示例2: AddJoin
private void AddJoin(JoinSequence joinSequence, QueryTranslator q)
{
q.AddFromJoinOnly(pathExpressionParser.Name, joinSequence);
try
{
AddToCurrentJoin(joinSequence.ToJoinFragment(q.EnabledFilters, true).ToWhereFragmentString);
}
catch (MappingException me)
{
throw new QueryException(me);
}
}
示例3: AddJoinNodes
private void AddJoinNodes(QueryNode query, JoinSequence join, FromElement fromElement)
{
JoinFragment joinFragment = join.ToJoinFragment(
_walker.EnabledFilters,
fromElement.UseFromFragment || fromElement.IsDereferencedBySuperclassOrSubclassProperty,
fromElement.WithClauseFragment,
fromElement.WithClauseJoinAlias
);
SqlString frag = joinFragment.ToFromFragmentString;
SqlString whereFrag = joinFragment.ToWhereFragmentString;
// If the from element represents a JOIN_FRAGMENT and it is
// a theta-style join, convert its type from JOIN_FRAGMENT
// to FROM_FRAGMENT
if ( fromElement.Type == HqlSqlWalker.JOIN_FRAGMENT &&
( join.IsThetaStyle || SqlStringHelper.IsNotEmpty( whereFrag ) ) )
{
fromElement.Type = HqlSqlWalker.FROM_FRAGMENT;
fromElement.JoinSequence.SetUseThetaStyle( true ); // this is used during SqlGenerator processing
}
// If there is a FROM fragment and the FROM element is an explicit, then add the from part.
if ( fromElement.UseFromFragment /*&& StringHelper.isNotEmpty( frag )*/ )
{
SqlString fromFragment = ProcessFromFragment( frag, join ).Trim();
if ( log.IsDebugEnabled )
{
log.Debug( "Using FROM fragment [" + fromFragment + "]" );
}
ProcessDynamicFilterParameters(fromFragment,fromElement,_walker);
}
_syntheticAndFactory.AddWhereFragment(
joinFragment,
whereFrag,
query,
fromElement,
_walker
);
}