本文整理汇总了C#中IOuterJoinLoadable类的典型用法代码示例。如果您正苦于以下问题:C# IOuterJoinLoadable类的具体用法?C# IOuterJoinLoadable怎么用?C# IOuterJoinLoadable使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IOuterJoinLoadable类属于命名空间,在下文中一共展示了IOuterJoinLoadable类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AbstractEntityJoinWalker
public AbstractEntityJoinWalker(string rootSqlAlias, IOuterJoinLoadable persister, ISessionFactoryImplementor factory,
IDictionary<string, IFilter> enabledFilters)
: base(factory, enabledFilters)
{
this.persister = persister;
alias = rootSqlAlias;
}
示例2: AbstractEntityLoader
public AbstractEntityLoader(IOuterJoinLoadable persister, IType uniqueKeyType, ISessionFactoryImplementor factory,
IDictionary<string, IFilter> enabledFilters) : base(factory, enabledFilters)
{
this.uniqueKeyType = uniqueKeyType;
entityName = persister.EntityName;
this.persister = persister;
}
示例3: CriteriaJoinWalker
public CriteriaJoinWalker(IOuterJoinLoadable persister,CriteriaQueryTranslator translator,
ISessionFactoryImplementor factory, CriteriaImpl criteria, string rootEntityName,
IDictionary<string, IFilter> enabledFilters)
: base(translator.RootSQLAlias, persister, factory, enabledFilters)
{
this.translator = translator;
querySpaces = translator.GetQuerySpaces();
if (translator.HasProjection)
{
resultTypes = translator.ProjectedTypes;
InitProjection(
translator.GetSelect(enabledFilters),
translator.GetWhereCondition(enabledFilters),
translator.GetOrderBy(),
translator.GetGroupBy().ToString(),
LockMode.None
);
}
else
{
resultTypes = new IType[] {TypeFactory.ManyToOne(persister.EntityName)};
InitAll(translator.GetWhereCondition(enabledFilters), translator.GetOrderBy(), LockMode.None);
}
userAliasList.Add(criteria.Alias); //root entity comes *last*
userAliases = ArrayHelper.ToStringArray(userAliasList);
}
示例4: AbstractEntityJoinWalker
public AbstractEntityJoinWalker(string alias, IOuterJoinLoadable persister, ISessionFactoryImplementor factory,
IDictionary enabledFilters)
: base(factory, enabledFilters)
{
this.persister = persister;
this.alias = alias;
}
示例5: EntityLoader
public EntityLoader(
IOuterJoinLoadable persister,
string[] uniqueKey,
IType uniqueKeyType,
int batchSize,
LockMode lockMode,
ISessionFactoryImplementor factory,
IDictionary enabledFilters)
: base(persister, uniqueKeyType, factory, enabledFilters)
{
JoinWalker walker = new EntityJoinWalker(
persister,
uniqueKey,
uniqueKeyType,
batchSize,
lockMode,
factory,
enabledFilters
);
InitFromWalker(walker);
PostInstantiate();
batchLoader = batchSize > 1;
log.Debug("Static select for entity " + entityName + ": " + SqlString);
}
示例6: GetLHSColumnNames
/// <summary>
/// Get the columns of the owning entity which are to
/// be used in the join
/// </summary>
public static string[] GetLHSColumnNames(
IAssociationType type,
int property,
int begin,
IOuterJoinLoadable lhsPersister,
IMapping mapping
)
{
if (type.UseLHSPrimaryKey)
{
//return lhsPersister.getSubclassPropertyColumnNames(property);
return lhsPersister.IdentifierColumnNames;
}
else
{
string propertyName = type.LHSPropertyName;
if (propertyName == null)
{
//slice, to get the columns for this component
//property
return ArrayHelper.Slice(
lhsPersister.GetSubclassPropertyColumnNames(property),
begin,
type.GetColumnSpan(mapping)
);
}
else
{
//property-refs for associations defined on a
//component are not supported, so no need to slice
return lhsPersister.GetPropertyColumnNames(propertyName);
}
}
}
示例7: InitStatementString
private void InitStatementString(IOuterJoinLoadable elementPersister, string alias, int batchSize, SqlString subquery)
{
int joins = CountEntityPersisters(associations);
Suffixes = BasicLoader.GenerateSuffixes(joins + 1);
int collectionJoins = CountCollectionPersisters(associations) + 1;
CollectionSuffixes = BasicLoader.GenerateSuffixes(joins + 1, collectionJoins);
SqlStringBuilder whereString = WhereString(alias, oneToManyPersister.KeyColumnNames, subquery, batchSize);
string filter = oneToManyPersister.FilterFragment(alias, EnabledFilters);
whereString.Insert(0, StringHelper.MoveAndToBeginning(filter));
JoinFragment ojf = MergeOuterJoins(associations);
SqlSelectBuilder select =
new SqlSelectBuilder(Factory).SetSelectClause(
oneToManyPersister.SelectFragment(null, null, alias, Suffixes[joins], CollectionSuffixes[0], true)
+ SelectString(associations)).SetFromClause(elementPersister.FromTableFragment(alias)
+ elementPersister.FromJoinFragment(alias, true, true)).SetWhereClause(
whereString.ToSqlString()).SetOuterJoins(ojf.ToFromFragmentString,
ojf.ToWhereFragmentString
+ elementPersister.WhereJoinFragment(alias, true, true));
select.SetOrderByClause(OrderBy(associations, oneToManyPersister.GetSQLOrderByString(alias)));
if (Factory.Settings.IsCommentsEnabled)
{
select.SetComment("load one-to-many " + oneToManyPersister.Role);
}
SqlString = select.ToSqlString();
}
示例8: CriteriaLoader
public CriteriaLoader(IOuterJoinLoadable persister, ISessionFactoryImplementor factory, CriteriaImpl rootCriteria,
string rootEntityName, IDictionary<string, IFilter> enabledFilters)
: base(factory, enabledFilters)
{
translator = new CriteriaQueryTranslator(factory, rootCriteria, rootEntityName, CriteriaQueryTranslator.RootSqlAlias);
querySpaces = translator.GetQuerySpaces();
CriteriaJoinWalker walker =
new CriteriaJoinWalker(persister, translator, factory, rootCriteria, rootEntityName, enabledFilters);
InitFromWalker(walker);
userAliases = walker.UserAliases;
resultTypes = walker.ResultTypes;
includeInResultRow = walker.IncludeInResultRow;
resultRowLength = ArrayHelper.CountTrue(IncludeInResultRow);
// fill caching objects only if there is a projection
if (translator.HasProjection)
{
cachedProjectedColumnAliases = translator.ProjectedColumnAliases;
}
PostInstantiate();
}
示例9: CriteriaLoader
public CriteriaLoader(
IOuterJoinLoadable persister,
ISessionFactoryImplementor factory,
CriteriaImpl rootCriteria,
System.Type rootEntityName, // TODO H3: change to string rootEntityName
IDictionary enabledFilters)
: base(factory, enabledFilters)
{
translator = new CriteriaQueryTranslator(
factory,
rootCriteria,
rootEntityName,
CriteriaQueryTranslator.RootSqlAlias);
querySpaces = translator.GetQuerySpaces();
CriteriaJoinWalker walker = new CriteriaJoinWalker(
persister,
translator,
factory,
rootCriteria,
rootEntityName,
enabledFilters);
InitFromWalker(walker);
userAliases = walker.UserAliases;
resultTypes = walker.ResultTypes;
PostInstantiate();
}
示例10: GetAliasedLHSColumnNames
/// <summary>
/// Get the aliased columns of the owning entity which are to
/// be used in the join
/// </summary>
public static string[] GetAliasedLHSColumnNames(
IAssociationType type,
string alias,
int property,
int begin,
IOuterJoinLoadable lhsPersister,
IMapping mapping
)
{
if (type.UseLHSPrimaryKey)
{
return StringHelper.Qualify(alias, lhsPersister.IdentifierColumnNames);
}
else
{
string propertyName = type.LHSPropertyName;
if (propertyName == null)
{
return ArrayHelper.Slice(
lhsPersister.ToColumns(alias, property),
begin,
type.GetColumnSpan(mapping)
);
}
else
{
return ((IPropertyMapping) lhsPersister).ToColumns(alias, propertyName); //bad cast
}
}
}
示例11: GetLHSColumnNames
/// <summary>
/// Get the columns of the owning entity which are to
/// be used in the join
/// </summary>
public static string[] GetLHSColumnNames(
IAssociationType type,
int property,
IOuterJoinLoadable lhsPersister,
IMapping mapping
)
{
return GetLHSColumnNames(type, property, 0, lhsPersister, mapping);
}
示例12: WalkCompositeComponentIdTree
private void WalkCompositeComponentIdTree(IOuterJoinLoadable persister, string alias, string path)
{
IType type = persister.IdentifierType;
string propertyName = persister.IdentifierPropertyName;
if (type != null && type.IsComponentType && !(type is EmbeddedComponentType))
{
ILhsAssociationTypeSqlInfo associationTypeSQLInfo = JoinHelper.GetIdLhsSqlInfo(alias, persister, Factory);
WalkComponentTree((IAbstractComponentType)type, 0, alias, SubPath(path, propertyName), 0, associationTypeSQLInfo);
}
}
示例13: CascadeEntityLoader
public CascadeEntityLoader(IOuterJoinLoadable persister, CascadingAction action, ISessionFactoryImplementor factory)
: base(persister, persister.IdentifierType, factory, new CollectionHelper.EmptyMapClass<string, IFilter>())
{
JoinWalker walker = new CascadeEntityJoinWalker(persister, action, factory);
InitFromWalker(walker);
PostInstantiate();
log.Debug(string.Format("Static select for action {0} on entity {1}: {2}", action, entityName, SqlString));
}
示例14: CriteriaLoader
public CriteriaLoader( IOuterJoinLoadable persister, ISessionFactoryImplementor factory, CriteriaImpl criteria )
: base( persister, factory )
{
this.criteria = criteria;
AddAllToPropertySpaces( persister.PropertySpaces );
resultTypes = new IType[ 1 ];
resultTypes[ 0 ] = NHibernateUtil.Entity( persister.MappedClass );
SqlStringBuilder condition = new SqlStringBuilder( 10 );
bool foundCriterion = false;
foreach( CriteriaImpl.CriterionEntry ee in criteria.IterateExpressionEntries() )
{
if( foundCriterion )
{
condition.Add( " and " );
}
SqlString sqlString = ee.Criterion.ToSqlString(
factory,
criteria.GetPersistentClass( ee.Alias ),
ee.Alias,
criteria.AliasClasses );
condition.Add( sqlString );
foundCriterion = true;
}
if( !foundCriterion )
{
condition.Add( "1=1" ); // TODO: fix this ugliness
}
StringBuilder orderBy = new StringBuilder( 30 );
bool foundOrder = false;
foreach( Order ord in criteria.IterateOrderings() )
{
if( foundOrder )
{
orderBy.Append( StringHelper.CommaSpace );
}
orderBy.Append( ord.ToSqlString( factory, criteria.CriteriaClass, Alias ) );
foundOrder = true;
}
IList associations = WalkTree( persister, Alias, factory );
InitClassPersisters( associations );
InitStatementString( associations, condition.ToSqlString(), orderBy.ToString(), factory );
PostInstantiate();
}
示例15: CascadeEntityJoinWalker
public CascadeEntityJoinWalker(IOuterJoinLoadable persister, CascadingAction action,
ISessionFactoryImplementor factory)
: base(persister, factory, new CollectionHelper.EmptyMapClass<string, IFilter>())
{
cascadeAction = action;
SqlStringBuilder whereCondition = WhereString(Alias, persister.IdentifierColumnNames, 1)
//include the discriminator and class-level where, but not filters
.Add(persister.FilterFragment(Alias, new CollectionHelper.EmptyMapClass<string, IFilter>()));
InitAll(whereCondition.ToSqlString(), SqlString.Empty, LockMode.Read);
}