Provides a base class for SQL tables, both stand-alone tables and joined tables.
    public void AddGroupReferenceMapping (SqlGroupingSelectExpression groupingSelectExpression, SqlTableBase sqlTable)
    {
      ArgumentUtility.CheckNotNull ("groupingSelectExpression", groupingSelectExpression);
      ArgumentUtility.CheckNotNull ("sqlTable", sqlTable);

      _groupReferenceMapping[groupingSelectExpression] = sqlTable;
    }
    public void AddSqlEntityMapping (SqlEntityExpression entityExpression, SqlTableBase sqlTable)
    {
      ArgumentUtility.CheckNotNull ("entityExpression", entityExpression);
      ArgumentUtility.CheckNotNull ("sqlTable", sqlTable);

      _entityMapping[entityExpression] = sqlTable;
    }
 private static void GenerateSqlForJoins (SqlTableBase sqlTable, ISqlCommandBuilder commandBuilder, IJoinInfoVisitor visitor)
 {
   foreach (var joinedTable in sqlTable.JoinedTables)
   {
     GenerateTextForSqlJoinedTable (visitor, joinedTable, commandBuilder);
     GenerateSqlForJoins (joinedTable, commandBuilder, visitor);
   }
 }
    protected SubStatementReferenceResolver (ResolvedSubStatementTableInfo tableInfo, SqlTableBase sqlTable, IMappingResolutionContext context)
    {
      ArgumentUtility.CheckNotNull ("tableInfo", tableInfo);
      ArgumentUtility.CheckNotNull ("sqlTable", sqlTable);
      ArgumentUtility.CheckNotNull ("context", context);

      _tableInfo = tableInfo;
      _sqlTable = sqlTable;
      _context = context;
    }
    public static Expression ResolveSubStatementReferenceExpression (
        Expression referencedExpression,
        ResolvedSubStatementTableInfo containingSubStatementTableInfo,
        SqlTableBase containingSqlTable,
        IMappingResolutionContext context)
    {
      ArgumentUtility.CheckNotNull ("referencedExpression", referencedExpression);
      ArgumentUtility.CheckNotNull ("containingSubStatementTableInfo", containingSubStatementTableInfo);
      ArgumentUtility.CheckNotNull ("containingSqlTable", containingSqlTable);
      
      var visitor = new SubStatementReferenceResolver (containingSubStatementTableInfo, containingSqlTable, context);
      var result = visitor.VisitExpression (referencedExpression);

      return result;
    }
 private SqlStatement GetSubStatement (SqlTableBase sqlTableBase)
 {
   return ((ResolvedSubStatementTableInfo) ((SqlTable) sqlTableBase).TableInfo).SqlStatement;
 }
      public SimplifyingVisitor (SqlTableBase oldElementSource, Expression newElementExpression)
      {
        ArgumentUtility.CheckNotNull ("oldElementSource", oldElementSource);
        ArgumentUtility.CheckNotNull ("newElementExpression", newElementExpression);

        _oldElementSource = oldElementSource;
        _newElementExpression = newElementExpression;

        CanBeTransferredToGroupingSource = true;
      }