本文整理汇总了C#中ILoadable类的典型用法代码示例。如果您正苦于以下问题:C# ILoadable类的具体用法?C# ILoadable怎么用?C# ILoadable使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ILoadable类属于命名空间,在下文中一共展示了ILoadable类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ThrowIfTargetNotLoadable
private void ThrowIfTargetNotLoadable(ILoadable target)
{
if(target == null)
{
throw new InterceptionTypeNotLoadableException();
}
}
示例2: InitProjection
protected void InitProjection(SqlString projectionString, SqlString whereString,
string orderByString, string groupByString, LockMode lockMode)
{
WalkEntityTree(persister, Alias);
Persisters = new ILoadable[0];
InitStatementString(projectionString, whereString, orderByString, groupByString, lockMode);
}
示例3: DefaultEntityAliases
/// <summary>
/// Calculate and cache select-clause suffixes.
/// </summary>
public DefaultEntityAliases(IDictionary<string, string[]> userProvidedAliases, ILoadable persister, string suffix)
{
this.suffix = suffix;
this.userProvidedAliases = userProvidedAliases;
string[] keyColumnsCandidates = GetUserProvidedAliases(persister.IdentifierPropertyName, null);
if (keyColumnsCandidates == null)
{
suffixedKeyColumns = GetUserProvidedAliases(EntityPersister.EntityID, GetIdentifierAliases(persister, suffix));
}
else
{
suffixedKeyColumns = keyColumnsCandidates;
}
Intern(suffixedKeyColumns);
suffixedPropertyColumns = GetSuffixedPropertyAliases(persister);
suffixedDiscriminatorColumn =
GetUserProvidedAlias(AbstractEntityPersister.EntityClass, GetDiscriminatorAlias(persister, suffix));
if (persister.IsVersioned)
{
suffixedVersionColumn = suffixedPropertyColumns[persister.VersionProperty];
}
else
{
suffixedVersionColumn = null;
}
rowIdAlias = Loadable.RowIdAlias + suffix; // TODO: not visible to the user!
}
示例4: SimpleEntityLoader
public SimpleEntityLoader( ILoadable persister, SqlString sql, LockMode lockMode )
{
this.persister = new ILoadable[ ] {persister};
this.idType = persister.IdentifierType;
this.sql = sql;
this.lockMode = new LockMode[ ] {lockMode};
PostInstantiate();
}
示例5: RenderStatement
private void RenderStatement( ILoadable[ ] persisters )
{
int loadables = persisters.Length;
Persisters = persisters;
Suffixes = GenerateSuffixes( loadables );
lockModeArray = CreateLockModeArray( loadables, LockMode.None );
SqlString = SubstituteParams( SubstituteBrackets() );
}
示例6: SubselectFetch
public SubselectFetch(string alias, ILoadable loadable, QueryParameters queryParameters,
ISet<EntityKey> resultingEntityKeys)
{
this.resultingEntityKeys = resultingEntityKeys;
this.queryParameters = queryParameters;
this.loadable = loadable;
this.alias = alias;
queryString = queryParameters.ProcessedSql.GetSubselectString();
}
示例7: InitClassPersisters
protected void InitClassPersisters( IList associations )
{
int joins = CountClassPersisters( associations );
collectionOwner = -1; // if no collection found
classPersisters = new ILoadable[ joins + 1 ];
Owners = new int[ joins + 1 ];
aliases = new string[ joins + 1 ];
lockModeArray = CreateLockModeArray( joins + 1, LockMode.None );
int i = 0;
foreach( OuterJoinableAssociation oj in associations )
{
object subpersister = oj.Joinable;
if( subpersister is ILoadable )
{
classPersisters[ i ] = ( ILoadable ) subpersister;
Owners[ i ] = ToOwner( oj, joins, oj.IsOneToOne );
aliases[ i ] = oj.Subalias;
if( oj.JoinType == JoinType.InnerJoin )
{
AddAllToPropertySpaces( classPersisters[ i ].PropertySpaces );
}
i++;
}
else
{
IQueryableCollection collPersister = ( IQueryableCollection ) subpersister;
// TODO: ?? suppress initialization of collections with a where condition
if( oj.JoinType == JoinType.LeftOuterJoin )
{
collectionPersister = collPersister;
collectionOwner = ToOwner( oj, joins, true );
}
else
{
AddToPropertySpaces( collPersister.CollectionSpace );
}
if( collPersister.IsOneToMany )
{
classPersisters[ i ] = ( ILoadable ) collPersister.ElementPersister;
aliases[ i ] = oj.Subalias;
i++;
}
}
}
classPersisters[ joins ] = persister;
Owners[ joins ] = -1;
aliases[ joins ] = alias;
if( ArrayHelper.IsAllNegative( Owners ) )
{
Owners = null;
}
}
示例8: SubselectFetch
public SubselectFetch(string alias, ILoadable loadable, QueryParameters queryParameters,
ISet<EntityKey> resultingEntityKeys, IDictionary<string, int[]> namedParameterLocMap)
{
this.resultingEntityKeys = resultingEntityKeys;
this.queryParameters = queryParameters;
this.namedParameterLocMap = namedParameterLocMap;
this.loadable = loadable;
this.alias = alias;
queryString = queryParameters.FilteredSQL.GetSubselectString();
}
示例9: InitProjection
protected void InitProjection(CriteriaQueryTranslator translator,
IDictionary<string, IFilter> enabledFilters, LockMode lockMode)
{
// the order of the calls here is important, as the join clauses can contain parameter bindings
SqlString projectionString = translator.GetSelect(enabledFilters);
WalkEntityTree(persister, Alias);
SqlString whereString = translator.GetWhereCondition(enabledFilters);
SqlString orderByString = translator.GetOrderBy();
SqlString groupByString = translator.GetGroupBy();
SqlString havingString = translator.GetHavingCondition(enabledFilters);
Persisters = new ILoadable[0];
InitStatementString(projectionString, whereString, orderByString, groupByString.ToString(),
havingString, lockMode);
}
示例10: InitClassPersisters
private void InitClassPersisters( IList associations )
{
int joins = associations.Count;
lockModeArray = CreateLockModeArray( joins, LockMode.None );
classPersisters = new ILoadable[joins];
Owners = new int[joins];
int i = 0;
foreach( OuterJoinableAssociation oj in associations )
{
classPersisters[ i ] = ( ILoadable ) oj.Joinable;
Owners[ i ] = ToOwner( oj, joins, oj.IsOneToOne );
i++;
}
if( ArrayHelper.IsAllNegative( Owners ) )
{
Owners = null;
}
}
示例11: InitClassPersisters
private void InitClassPersisters( IOuterJoinLoadable persister, IList associations )
{
int joins = associations.Count;
lockModeArray = CreateLockModeArray( joins + 1, LockMode.None );
classPersisters = new ILoadable[joins + 1];
Owners = new int[ joins + 1 ];
for( int i = 0; i < joins; i++ )
{
OuterJoinableAssociation oj = ( OuterJoinableAssociation ) associations[ i ];
Persisters[ i ] = (ILoadable) oj.Joinable;
Owners[ i ] = ToOwner( oj, joins, oj.IsOneToOne );
}
classPersisters[ joins ] = persister;
Owners[ joins ] = -1;
if ( ArrayHelper.IsAllNegative( Owners ) )
{
Owners = null;
}
}
示例12: GenerateSequentialSelect
private SqlString GenerateSequentialSelect(ILoadable persister)
{
//note that this method could easily be moved up to BasicEntityPersister,
//if we ever needed to reuse it from other subclasses
//figure out which tables need to be fetched
AbstractEntityPersister subclassPersister = (AbstractEntityPersister)persister;
HashedSet<int> tableNumbers = new HashedSet<int>();
string[] props = subclassPersister.PropertyNames;
string[] classes = subclassPersister.PropertySubclassNames;
for (int i = 0; i < props.Length; i++)
{
int propTableNumber = GetSubclassPropertyTableNumber(props[i], classes[i]);
if (IsSubclassTableSequentialSelect(propTableNumber) && !IsSubclassTableLazy(propTableNumber))
{
tableNumbers.Add(propTableNumber);
}
}
if ((tableNumbers.Count == 0))
return null;
//figure out which columns are needed
List<int> columnNumbers = new List<int>();
int[] columnTableNumbers = SubclassColumnTableNumberClosure;
for (int i = 0; i < SubclassColumnClosure.Length; i++)
{
if (tableNumbers.Contains(columnTableNumbers[i]))
columnNumbers.Add(i);
}
//figure out which formulas are needed
List<int> formulaNumbers = new List<int>();
int[] formulaTableNumbers = SubclassColumnTableNumberClosure;
for (int i = 0; i < SubclassFormulaTemplateClosure.Length; i++)
{
if (tableNumbers.Contains(formulaTableNumbers[i]))
formulaNumbers.Add(i);
}
//render the SQL
return RenderSelect(ArrayHelper.ToIntArray(tableNumbers), columnNumbers.ToArray(), formulaNumbers.ToArray());
}
示例13: GetPropertyAliases
protected override string[] GetPropertyAliases(ILoadable persister, int j)
{
return persister.GetPropertyColumnNames(j);
}
示例14: GetDiscriminatorAlias
protected override string GetDiscriminatorAlias(ILoadable persister, string suffix)
{
return persister.DiscriminatorColumnName;
}
示例15: GetSuffixedPropertyAliases
public string[][] GetSuffixedPropertyAliases(ILoadable persister)
{
int size = persister.PropertyNames.Length;
string[][] suffixedPropertyAliases = new string[size][];
for (int j = 0; j < size; j++)
{
suffixedPropertyAliases[j] = GetUserProvidedAliases(persister.PropertyNames[j], GetPropertyAliases(persister, j));
Intern(suffixedPropertyAliases[j]);
}
return suffixedPropertyAliases;
}