本文整理汇总了C#中IQueryableCollection类的典型用法代码示例。如果您正苦于以下问题:C# IQueryableCollection类的具体用法?C# IQueryableCollection怎么用?C# IQueryableCollection使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IQueryableCollection类属于命名空间,在下文中一共展示了IQueryableCollection类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SubselectOneToManyLoader
public SubselectOneToManyLoader(IQueryableCollection persister, SqlString subquery, ICollection<EntityKey> entityKeys,
QueryParameters queryParameters,
ISessionFactoryImplementor factory, IDictionary<string, IFilter> enabledFilters)
: base(persister, BatchSizeForSubselectFetching, factory, enabledFilters)
{
keys = new object[entityKeys.Count];
int i = 0;
foreach (EntityKey entityKey in entityKeys)
{
keys[i++] = entityKey.Identifier;
}
// NH Different behavior: to deal with positionslParameter+NamedParameter+ParameterOfFilters
namedParameters = new Dictionary<string, TypedValue>(queryParameters.NamedParameters);
parametersSpecifications = queryParameters.ProcessedSqlParameters.ToList();
var processedRowSelection = queryParameters.ProcessedRowSelection;
SqlString finalSubquery = subquery;
if (queryParameters.ProcessedRowSelection != null && !SubselectClauseExtractor.HasOrderBy(queryParameters.ProcessedSql))
{
// when the original query has an "ORDER BY" we can't re-apply the pagination.
// This is a simplification, we should actually check which is the "ORDER BY" clause because when the "ORDER BY" is just for the PK we can re-apply "ORDER BY" and pagination.
finalSubquery = GetSubSelectWithLimits(subquery, parametersSpecifications, processedRowSelection, namedParameters);
}
InitializeFromWalker(persister, finalSubquery, BatchSizeForSubselectFetching, enabledFilters, factory);
types = queryParameters.PositionalParameterTypes;
values = queryParameters.PositionalParameterValues;
}
示例2: OneToManyLoader
public OneToManyLoader(
IQueryableCollection oneToManyPersister,
ISessionFactoryImplementor session,
IDictionary enabledFilters)
: this(oneToManyPersister, 1, session, enabledFilters)
{
}
示例3: BasicCollectionJoinWalker
public BasicCollectionJoinWalker(
IQueryableCollection collectionPersister,
int batchSize,
SqlString subquery,
ISessionFactoryImplementor factory,
IDictionary enabledFilters)
: base(factory, enabledFilters)
{
this.collectionPersister = collectionPersister;
string alias = GenerateRootAlias(collectionPersister.Role);
WalkCollectionTree(collectionPersister, alias);
IList allAssociations = new ArrayList();
ArrayHelper.AddAll(allAssociations, associations);
allAssociations.Add(new OuterJoinableAssociation(
collectionPersister.CollectionType,
null,
null,
alias,
JoinType.LeftOuterJoin,
Factory,
enabledFilters
));
InitPersisters(allAssociations, LockMode.None);
InitStatementString(alias, batchSize, subquery);
}
示例4: InitStatementString
private void InitStatementString( IQueryableCollection persister, string alias, IList associations, int batchSize, ISessionFactoryImplementor factory )
{
Suffixes = GenerateSuffixes( associations.Count );
SqlStringBuilder whereString = WhereString( factory, alias, persister.KeyColumnNames, persister.KeyType, batchSize );
if( persister.HasWhere )
{
whereString
.Add( " and " )
.Add( persister.GetSQLWhereString( alias ) );
}
JoinFragment ojf = MergeOuterJoins( associations );
SqlSelectBuilder select = new SqlSelectBuilder( factory )
.SetSelectClause(
persister.SelectFragment( alias ).Append(
SelectString( associations, factory ) ).ToString()
)
.SetFromClause( persister.TableName, alias )
.SetWhereClause( whereString.ToSqlString() )
.SetOuterJoins(
ojf.ToFromFragmentString,
ojf.ToWhereFragmentString
);
if( persister.HasOrdering )
{
select.SetOrderByClause( persister.GetSQLOrderByString( alias ) );
}
SqlString = select.ToSqlString();
}
示例5: BasicCollectionLoader
public BasicCollectionLoader(
IQueryableCollection collectionPersister,
ISessionFactoryImplementor session,
IDictionary<string, IFilter> enabledFilters)
: this(collectionPersister, 1, session, enabledFilters)
{
}
示例6: InitializeFromWalker
protected virtual void InitializeFromWalker(IQueryableCollection oneToManyPersister, SqlString subquery, int batchSize, IDictionary<string, IFilter> enabledFilters, ISessionFactoryImplementor factory)
{
JoinWalker walker = new OneToManyJoinWalker(oneToManyPersister, batchSize, subquery, factory, enabledFilters);
InitFromWalker(walker);
PostInstantiate();
log.Debug("Static select for one-to-many " + oneToManyPersister.Role + ": " + SqlString);
}
示例7: BasicCollectionLoader
protected BasicCollectionLoader(IQueryableCollection collectionPersister, int batchSize, SqlString subquery,
ISessionFactoryImplementor factory, IDictionary<string, IFilter> enabledFilters)
: base(collectionPersister, factory, enabledFilters)
{
JoinWalker walker = new BasicCollectionJoinWalker(collectionPersister, batchSize, subquery, factory, enabledFilters);
InitFromWalker(walker);
PostInstantiate();
log.Debug("Static select for collection " + collectionPersister.Role + ": " + SqlString);
}
示例8: CollectionLoader
public CollectionLoader( IQueryableCollection persister, int batchSize, ISessionFactoryImplementor factory )
: base( factory.Dialect )
{
this.collectionPersister = persister;
this.keyType = persister.KeyType;
string alias = GenerateRootAlias( persister.Role );
IList associations = WalkCollectionTree( persister, alias, factory );
InitStatementString( persister, alias, associations, batchSize, factory );
InitClassPersisters( associations );
PostInstantiate();
}
示例9: CollectionElementLoader
public CollectionElementLoader(IQueryableCollection collectionPersister, ISessionFactoryImplementor factory, IDictionary<string, IFilter> enabledFilters)
: base(factory, enabledFilters)
{
keyType = collectionPersister.KeyType;
indexType = collectionPersister.IndexType;
persister = (IOuterJoinLoadable)collectionPersister.ElementPersister;
entityName = persister.EntityName;
JoinWalker walker = new EntityJoinWalker(persister, ArrayHelper.Join(collectionPersister.KeyColumnNames, collectionPersister.IndexColumnNames), 1, LockMode.None, factory, enabledFilters);
InitFromWalker(walker);
PostInstantiate();
log.Debug("Static select for entity " + entityName + ": " + SqlString);
}
示例10: OneToManyLoader
public OneToManyLoader( IQueryableCollection collPersister, int batchSize, ISessionFactoryImplementor factory )
: base( factory.Dialect )
{
collectionPersister = collPersister;
idType = collectionPersister.KeyType;
IOuterJoinLoadable persister = ( IOuterJoinLoadable ) collPersister.ElementPersister;
string alias = GenerateRootAlias( collPersister.Role );
IList associations = WalkTree( persister, alias, factory );
InitStatementString( collPersister, persister, alias, associations, batchSize, factory );
InitClassPersisters( persister, associations );
PostInstantiate();
}
示例11: ComponentCollectionCriteriaInfoProvider
public ComponentCollectionCriteriaInfoProvider(IQueryableCollection persister)
{
this.persister = persister;
if (!persister.ElementType.IsComponentType)
{
throw new ArgumentException("persister for role " + persister.Role + " is not a collection-of-component");
}
var componentType = (IAbstractComponentType) persister.ElementType;
string[] names = componentType.PropertyNames;
IType[] types = componentType.Subtypes;
for (int i = 0; i < names.Length; i++)
{
subTypes.Add(names[i], types[i]);
}
}
示例12: SubselectOneToManyLoader
public SubselectOneToManyLoader(IQueryableCollection persister, SqlString subquery, ICollection<EntityKey> entityKeys,
QueryParameters queryParameters, IDictionary<string, int[]> namedParameterLocMap,
ISessionFactoryImplementor factory, IDictionary<string, IFilter> enabledFilters)
: base(persister, 1, subquery, factory, enabledFilters)
{
keys = new object[entityKeys.Count];
int i = 0;
foreach (EntityKey entityKey in entityKeys)
{
keys[i++] = entityKey.Identifier;
}
namedParameters = queryParameters.NamedParameters;
// NH Different behavior: to deal with positionslParameter+NamedParameter+ParameterOfFilters
types = queryParameters.PositionalParameterTypes;
values = queryParameters.PositionalParameterValues;
this.namedParameterLocMap = namedParameterLocMap;
}
示例13: OneToManyJoinWalker
public OneToManyJoinWalker(IQueryableCollection oneToManyPersister, int batchSize, SqlString subquery,
ISessionFactoryImplementor factory, IDictionary<string, IFilter> enabledFilters)
: base(factory, enabledFilters)
{
this.oneToManyPersister = oneToManyPersister;
IOuterJoinLoadable elementPersister = (IOuterJoinLoadable) oneToManyPersister.ElementPersister;
string alias = GenerateRootAlias(oneToManyPersister.Role);
WalkEntityTree(elementPersister, alias);
IList<OuterJoinableAssociation> allAssociations = new List<OuterJoinableAssociation>(associations);
allAssociations.Add(
new OuterJoinableAssociation(oneToManyPersister.CollectionType, null, null, alias, JoinType.LeftOuterJoin, null, Factory,
new CollectionHelper.EmptyMapClass<string, IFilter>()));
InitPersisters(allAssociations, LockMode.None);
InitStatementString(elementPersister, alias, batchSize, subquery);
}
示例14: BasicCollectionJoinWalker
public BasicCollectionJoinWalker(IQueryableCollection collectionPersister, int batchSize,
SqlString subquery, ISessionFactoryImplementor factory, IDictionary<string, IFilter> enabledFilters)
: base(factory, enabledFilters)
{
this.collectionPersister = collectionPersister;
string alias = GenerateRootAlias(collectionPersister.Role);
WalkCollectionTree(collectionPersister, alias);
IList<OuterJoinableAssociation> allAssociations = new List<OuterJoinableAssociation>(associations);
// NH Different behavior : passing enabledFilters instead empty-filter
allAssociations.Add(
new OuterJoinableAssociation(collectionPersister.CollectionType, null, null, alias, JoinType.LeftOuterJoin, null, Factory,
enabledFilters));
InitPersisters(allAssociations, LockMode.None);
InitStatementString(alias, batchSize, subquery);
}
示例15: CreateBatchingCollectionInitializer
public static ICollectionInitializer CreateBatchingCollectionInitializer(IQueryableCollection persister,
int maxBatchSize,
ISessionFactoryImplementor factory,
IDictionary<string, IFilter> enabledFilters)
{
if (maxBatchSize > 1)
{
int[] batchSizesToCreate = ArrayHelper.GetBatchSizes(maxBatchSize);
Loader[] loadersToCreate = new Loader[batchSizesToCreate.Length];
for (int i = 0; i < batchSizesToCreate.Length; i++)
{
loadersToCreate[i] = new BasicCollectionLoader(persister, batchSizesToCreate[i], factory, enabledFilters);
}
return new BatchingCollectionInitializer(persister, batchSizesToCreate, loadersToCreate);
}
else
{
return new BasicCollectionLoader(persister, factory, enabledFilters);
}
}