Пример #1
0
		public SqlColumnAlias(SqlTableAlias sqlTableAlias, SqlColumn sqlColumn, string alias)
		{
			this.Parent = sqlTableAlias;
			this.sqlColumn = sqlColumn;
			this.alias = alias;
			sqlTableAlias.SqlColumnAliases.Add(this);
		}
 public SqlJoinTableSource(SqlFromClause sqlFromClause, SqlTableAlias leftTable, SqlTableAlias rightTable, SqlJoinType joinType)
     : base(sqlFromClause)
 {
     this.Parent = sqlFromClause;
     this.leftSqlTableAlias = leftTable;
     this.rightTableAlias = rightTable;
     this.sqlJoinType = joinType;
 }
Пример #3
0
 public SqlJoinTableSource AddSqlJoinTableSource(SqlTableAlias leftTable, SqlTableAlias rightTable, SqlJoinType joinType)
 {
     return new SqlJoinTableSource(this, leftTable, rightTable, joinType) ;
 }
 public SqlTableAliasReference(SqlTableAlias sqlTableAlias)
 {
     this.sqlTableAlias = sqlTableAlias;
 }
 public SqlJoinTableSource(SqlFromClause sqlFromClause, SqlTableAlias leftTable, SqlTableAlias rightTable, SqlJoinType joinType) : base(sqlFromClause)
 {
     this.Parent            = sqlFromClause;
     this.leftSqlTableAlias = leftTable;
     this.rightTableAlias   = rightTable;
     this.sqlJoinType       = joinType;
 }
Пример #6
0
 public SqlAliasTableSource AddSqlAliasTableSource(SqlTableAlias sqlTableAlias)
 {
     return new SqlAliasTableSource(this, sqlTableAlias) ;
 }
Пример #7
0
 public virtual void Visited(SqlTableAlias tableAlias)
 {
 }
 public SqlAllColumnsInTableSelectListItem AddSqlAllColumnsInTableSelectListItem(SqlTableAlias sqlTableAlias)
 {
     SqlTableAliasReference sqlTableAliasReference = new SqlTableAliasReference(sqlTableAlias);
     return AddSqlAllColumnsInTableSelectListItem(sqlTableAliasReference) ;
 }
Пример #9
0
        public SqlAliasTableSource AddSqlAliasTableSource(string name)
        {
            SqlTableAlias sqlTableAlias = this.SqlStatement.GetSqlTableAlias(name);

            return(AddSqlAliasTableSource(sqlTableAlias));
        }
Пример #10
0
 public FromTable(SqlTableAlias alias, SqlTableAlias linksToAlias)
 {
     this.alias = alias;
     this.linksToAlias = linksToAlias;
 }
Пример #11
0
        public SqlAllColumnsInTableSelectListItem AddSqlAllColumnsInTableSelectListItem(SqlTableAlias sqlTableAlias)
        {
            SqlTableAliasReference sqlTableAliasReference = new SqlTableAliasReference(sqlTableAlias);

            return(AddSqlAllColumnsInTableSelectListItem(sqlTableAliasReference));
        }
Пример #12
0
 public SqlColumnAlias FindSqlColumnAlias(SqlTableAlias sqlTableAlias, string name, string alias, string tableAlias)
 {
     if (sqlTableAlias != null)
         return sqlTableAlias.FindSqlColumnAlias(name, alias);
     return null ;
 }
Пример #13
0
        public SqlAllColumnsInTableSelectListItem AddSqlAllColumnsInTableSelectListItem(SqlTable sqlTable)
        {
            SqlTableAlias sqlTableAlias = this.SqlStatement.GetSqlTableAlias(sqlTable.Name);

            return(AddSqlAllColumnsInTableSelectListItem(sqlTableAlias));
        }
Пример #14
0
        public SqlAllColumnsInTableSelectListItem AddSqlAllColumnsInTableSelectListItem(ITableMap tableMap)
        {
            SqlTableAlias sqlTableAlias = this.SqlStatement.GetSqlTableAlias(tableMap);

            return(AddSqlAllColumnsInTableSelectListItem(sqlTableAlias));
        }
Пример #15
0
 public SqlColumnAlias(SqlTableAlias sqlTableAlias, SqlColumn sqlColumn) : this(sqlTableAlias, sqlColumn, "")
 {
 }
Пример #16
0
		public SqlColumnAlias(SqlTableAlias sqlTableAlias, SqlColumn sqlColumn) : this(sqlTableAlias, sqlColumn, "") {}
Пример #17
0
 public SqlAliasTableSource AddSqlAliasTableSource(SqlTableAlias sqlTableAlias)
 {
     return(new SqlAliasTableSource(this, sqlTableAlias));
 }
Пример #18
0
 public SqlTableAlias GetSqlTableAlias(ITableMap tableMap, string alias)
 {
     SqlTableAlias sqlTableAlias = FindSqlTableAlias(tableMap.Name, alias) ;
     if (sqlTableAlias == null)
     {
         SqlTable sqlTable = GetSqlTable(tableMap);
         sqlTableAlias = new SqlTableAlias(this, sqlTable, alias) ;
     }
     return sqlTableAlias;
 }
 public SqlAliasTableSource(SqlFromClause sqlFromClause, SqlTableAlias sqlTableAlias) : base(sqlFromClause)
 {
     this.sqlTableAlias = sqlTableAlias;
 }
Пример #20
0
        public SqlAliasTableSource AddSqlAliasTableSource(ITableMap tableMap)
        {
            SqlTableAlias sqlTableAlias = this.SqlStatement.GetSqlTableAlias(tableMap);

            return(AddSqlAliasTableSource(sqlTableAlias));
        }
Пример #21
0
 public SqlTableAlias GetSqlTableAlias(string name, string alias)
 {
     SqlTableAlias sqlTableAlias = FindSqlTableAlias(name, alias) ;
     if (sqlTableAlias == null)
     {
         SqlTable sqlTable = GetSqlTable(name);
         sqlTableAlias = new SqlTableAlias(this, sqlTable, alias) ;
     }
     return sqlTableAlias;
 }
Пример #22
0
 public SqlJoinTableSource AddSqlJoinTableSource(SqlTableAlias leftTable, SqlTableAlias rightTable, SqlJoinType joinType)
 {
     return(new SqlJoinTableSource(this, leftTable, rightTable, joinType));
 }
 public SqlTableAliasReference(SqlTableAlias sqlTableAlias)
 {
     this.sqlTableAlias = sqlTableAlias;
 }
Пример #24
0
 public virtual void Visiting(SqlTableAlias tableAlias)
 {
     string tableName = tableAlias.SqlTable.Name;
     string alias = tableAlias.Alias;
     sqlBuilder.Append(EncapsulateTable(tableName));
     if (tableName != alias)
         sqlBuilder.Append(" " + this.TableAliasKeyword + EncapsulateTable(alias));
 }
 public virtual SqlColumnAlias GetPropertyColumnAlias(SqlTableAlias tableAlias, IPropertyMap propertyMap, string propertyPath, string suggestion)
 {
     return sqlEmitter.GetColumnAlias(tableAlias, propertyMap.GetColumnMap(), propertyPath, GetAliasSuggestionFromPropertyPath(propertyPath, suggestion))  ;
 }
 public SqlAliasTableSource(SqlFromClause sqlFromClause, SqlTableAlias sqlTableAlias)
     : base(sqlFromClause)
 {
     this.sqlTableAlias = sqlTableAlias;
 }
Пример #27
0
		public SqlColumnAlias GetColumnAlias(SqlTableAlias tableAlias, IColumnMap columnMap, object hash, string suggestion)
		{
			string alias;

			if (hash is IPropertyMap)
			{
				if (((IPropertyMap) hash).ClassMap == this.rootClassMap || ((IPropertyMap) hash).ClassMap == this.baseClassMap)
				{
					hash = this.baseClassMap;
				}				
			}
			else if (hash is TableJoin)
			{
				hash = ((TableJoin) hash).GetPropertyPath();
			}
			else if (hash is string)
			{
				if (((string)hash).Length < 1)
				{
					hash = this.baseClassMap;					
				}
			}

			if (!columnAliases.Contains(columnMap))
			{
				columnAliases[columnMap] = new Hashtable();
			}				

			Hashtable propertyColumnAliases = (Hashtable) columnAliases[columnMap];

			if (propertyColumnAliases.Contains(hash))
			{
				alias = (string) propertyColumnAliases[hash];
				return tableAlias.GetSqlColumnAlias(columnMap, alias);
			}

			if (suggestion.Length > 0)
				alias = suggestion;
			else
				alias = CreateColumnAlias();
			propertyColumnAliases[hash] = alias;
			return tableAlias.GetSqlColumnAlias(columnMap, alias);
		}