Skip to content

Commit

Permalink
Better overrides for aggregate phrases
Browse files Browse the repository at this point in the history
  • Loading branch information
danielgindi committed Feb 3, 2016
1 parent 27f65cf commit f436600
Show file tree
Hide file tree
Showing 10 changed files with 252 additions and 75 deletions.
20 changes: 17 additions & 3 deletions dg.Sql/Sql/Phrases/Quantitative/Aggregate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,35 @@ public class PassThroughAggregate : IPhrase
ValueObjectType ObjectType;
string AggregateType;

[Obsolete]
public PassThroughAggregate(string aggregateType, string tableName, object anObject, ValueObjectType objectType)
{
this.TableName = tableName;
this.Object = anObject;
this.ObjectType = objectType;
this.AggregateType = aggregateType;
}
public PassThroughAggregate(string aggregateType, object anObject, ValueObjectType objectType)
: this(aggregateType, null, anObject, objectType)

public PassThroughAggregate(string aggregateType, string tableName, string columnName)
{
this.TableName = tableName;
this.Object = columnName;
this.ObjectType = ValueObjectType.ColumnName;
this.AggregateType = aggregateType;
}

public PassThroughAggregate(string aggregateType, string columnName)
: this(aggregateType, null, columnName, ValueObjectType.ColumnName)
: this(aggregateType, null, ValueObjectType.ColumnName)
{
}

public PassThroughAggregate(string aggregateType, object anObject, ValueObjectType objectType)
{
this.Object = anObject;
this.ObjectType = objectType;
this.AggregateType = aggregateType;
}

public string BuildPhrase(ConnectorBase conn)
{
string ret;
Expand Down
35 changes: 27 additions & 8 deletions dg.Sql/Sql/Phrases/Quantitative/Avg.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,40 @@ public class Avg : IPhrase
string TableName;
object Object;
ValueObjectType ObjectType;


public Avg(string TableName, object Object, ValueObjectType ObjectType)
[Obsolete]
public Avg(string tableName, object anObject, ValueObjectType objectType)
{
this.TableName = TableName;
this.Object = Object;
this.ObjectType = ObjectType;
this.TableName = tableName;
this.Object = anObject;
this.ObjectType = objectType;
}
public Avg(object Object, ValueObjectType ObjectType)
: this(null, Object, ObjectType)

public Avg()
{
this.Object = "*";
this.ObjectType = ValueObjectType.Literal;
}
public Avg(string ColumnName)
: this(null, ColumnName, ValueObjectType.ColumnName)

public Avg(string tableName, string columnName)
{
this.TableName = tableName;
this.Object = columnName;
this.ObjectType = ValueObjectType.ColumnName;
}

public Avg(string columnName)
: this(null, columnName)
{
}

public Avg(object anObject, ValueObjectType objectType)
{
this.Object = anObject;
this.ObjectType = objectType;
}

public string BuildPhrase(ConnectorBase conn)
{
string ret;
Expand Down
34 changes: 26 additions & 8 deletions dg.Sql/Sql/Phrases/Quantitative/Count.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,38 @@ public class Count : IPhrase
object Object;
ValueObjectType ObjectType;

public Count(string TableName, object Object, ValueObjectType ObjectType)
[Obsolete]
public Count(string tableName, object anObject, ValueObjectType objectType)
{
this.TableName = TableName;
this.Object = Object;
this.ObjectType = ObjectType;
this.TableName = tableName;
this.Object = anObject;
this.ObjectType = objectType;
}
public Count(object Object, ValueObjectType ObjectType)
: this(null, Object, ObjectType)

public Count()
{
this.Object = "*";
this.ObjectType = ValueObjectType.Literal;
}
public Count(string ColumnName)
: this(null, ColumnName, ValueObjectType.ColumnName)

public Count(string tableName, string columnName)
{
this.TableName = tableName;
this.Object = columnName;
this.ObjectType = ValueObjectType.ColumnName;
}

public Count(string columnName)
: this(null, columnName)
{
}

public Count(object anObject, ValueObjectType objectType)
{
this.Object = anObject;
this.ObjectType = objectType;
}

public string BuildPhrase(ConnectorBase conn)
{
string ret;
Expand Down
34 changes: 26 additions & 8 deletions dg.Sql/Sql/Phrases/Quantitative/Max.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,39 @@ public class Max : IPhrase
string TableName;
object Object;
ValueObjectType ObjectType;

[Obsolete]
public Max(string tableName, object anObject, ValueObjectType objectType)
{
this.TableName = tableName;
this.Object = anObject;
this.ObjectType = objectType;
}

public Max()
{
this.Object = "*";
this.ObjectType = ValueObjectType.Literal;
}

public Max(string TableName, object Object, ValueObjectType ObjectType)
public Max(string tableName, string columnName)
{
this.TableName = TableName;
this.Object = Object;
this.ObjectType = ObjectType;
this.TableName = tableName;
this.Object = columnName;
this.ObjectType = ValueObjectType.ColumnName;
}
public Max(object Object, ValueObjectType ObjectType)
: this(null, Object, ObjectType)

public Max(string columnName)
: this(null, columnName)
{
}
public Max(string ColumnName)
: this(null, ColumnName, ValueObjectType.ColumnName)

public Max(object anObject, ValueObjectType objectType)
{
this.Object = anObject;
this.ObjectType = objectType;
}

public string BuildPhrase(ConnectorBase conn)
{
string ret;
Expand Down
34 changes: 26 additions & 8 deletions dg.Sql/Sql/Phrases/Quantitative/Min.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,39 @@ public class Min : IPhrase
string TableName;
object Object;
ValueObjectType ObjectType;

[Obsolete]
public Min(string tableName, object anObject, ValueObjectType objectType)
{
this.TableName = tableName;
this.Object = anObject;
this.ObjectType = objectType;
}

public Min()
{
this.Object = "*";
this.ObjectType = ValueObjectType.Literal;
}

public Min(string TableName, object Object, ValueObjectType ObjectType)
public Min(string tableName, string columnName)
{
this.TableName = TableName;
this.Object = Object;
this.ObjectType = ObjectType;
this.TableName = tableName;
this.Object = columnName;
this.ObjectType = ValueObjectType.ColumnName;
}
public Min(object Object, ValueObjectType ObjectType)
: this(null, Object, ObjectType)

public Min(string columnName)
: this(null, columnName)
{
}
public Min(string ColumnName)
: this(null, ColumnName, ValueObjectType.ColumnName)

public Min(object anObject, ValueObjectType objectType)
{
this.Object = anObject;
this.ObjectType = objectType;
}

public string BuildPhrase(ConnectorBase conn)
{
string ret;
Expand Down
34 changes: 26 additions & 8 deletions dg.Sql/Sql/Phrases/Quantitative/StandardDeviationOfPopulation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,39 @@ public class StandardDeviationOfPopulation : IPhrase
string TableName;
object Object;
ValueObjectType ObjectType;

[Obsolete]
public StandardDeviationOfPopulation(string tableName, object anObject, ValueObjectType objectType)
{
this.TableName = tableName;
this.Object = anObject;
this.ObjectType = objectType;
}

public StandardDeviationOfPopulation()
{
this.Object = "*";
this.ObjectType = ValueObjectType.Literal;
}

public StandardDeviationOfPopulation(string TableName, object Object, ValueObjectType ObjectType)
public StandardDeviationOfPopulation(string tableName, string columnName)
{
this.TableName = TableName;
this.Object = Object;
this.ObjectType = ObjectType;
this.TableName = tableName;
this.Object = columnName;
this.ObjectType = ValueObjectType.ColumnName;
}
public StandardDeviationOfPopulation(object Object, ValueObjectType ObjectType)
: this(null, Object, ObjectType)

public StandardDeviationOfPopulation(string columnName)
: this(null, columnName)
{
}
public StandardDeviationOfPopulation(string ColumnName)
: this(null, ColumnName, ValueObjectType.ColumnName)

public StandardDeviationOfPopulation(object anObject, ValueObjectType objectType)
{
this.Object = anObject;
this.ObjectType = objectType;
}

public string BuildPhrase(ConnectorBase conn)
{
string ret;
Expand Down
34 changes: 26 additions & 8 deletions dg.Sql/Sql/Phrases/Quantitative/StandardDeviationOfSample.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,39 @@ public class StandardDeviationOfSample : IPhrase
string TableName;
object Object;
ValueObjectType ObjectType;

[Obsolete]
public StandardDeviationOfSample(string tableName, object anObject, ValueObjectType objectType)
{
this.TableName = tableName;
this.Object = anObject;
this.ObjectType = objectType;
}

public StandardDeviationOfSample()
{
this.Object = "*";
this.ObjectType = ValueObjectType.Literal;
}

public StandardDeviationOfSample(string TableName, object Object, ValueObjectType ObjectType)
public StandardDeviationOfSample(string tableName, string columnName)
{
this.TableName = TableName;
this.Object = Object;
this.ObjectType = ObjectType;
this.TableName = tableName;
this.Object = columnName;
this.ObjectType = ValueObjectType.ColumnName;
}
public StandardDeviationOfSample(object Object, ValueObjectType ObjectType)
: this(null, Object, ObjectType)

public StandardDeviationOfSample(string columnName)
: this(null, columnName)
{
}
public StandardDeviationOfSample(string ColumnName)
: this(null, ColumnName, ValueObjectType.ColumnName)

public StandardDeviationOfSample(object anObject, ValueObjectType objectType)
{
this.Object = anObject;
this.ObjectType = objectType;
}

public string BuildPhrase(ConnectorBase conn)
{
string ret;
Expand Down
34 changes: 26 additions & 8 deletions dg.Sql/Sql/Phrases/Quantitative/StandardVarianceOfPopulation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,39 @@ public class StandardVarianceOfPopulation : IPhrase
string TableName;
object Object;
ValueObjectType ObjectType;

[Obsolete]
public StandardVarianceOfPopulation(string tableName, object anObject, ValueObjectType objectType)
{
this.TableName = tableName;
this.Object = anObject;
this.ObjectType = objectType;
}

public StandardVarianceOfPopulation()
{
this.Object = "*";
this.ObjectType = ValueObjectType.Literal;
}

public StandardVarianceOfPopulation(string TableName, object Object, ValueObjectType ObjectType)
public StandardVarianceOfPopulation(string tableName, string columnName)
{
this.TableName = TableName;
this.Object = Object;
this.ObjectType = ObjectType;
this.TableName = tableName;
this.Object = columnName;
this.ObjectType = ValueObjectType.ColumnName;
}
public StandardVarianceOfPopulation(object Object, ValueObjectType ObjectType)
: this(null, Object, ObjectType)

public StandardVarianceOfPopulation(string columnName)
: this(null, columnName)
{
}
public StandardVarianceOfPopulation(string ColumnName)
: this(null, ColumnName, ValueObjectType.ColumnName)

public StandardVarianceOfPopulation(object anObject, ValueObjectType objectType)
{
this.Object = anObject;
this.ObjectType = objectType;
}

public string BuildPhrase(ConnectorBase conn)
{
string ret;
Expand Down
Loading

0 comments on commit f436600

Please sign in to comment.