Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Supports SQLLogicalExpression. Closes #66.
- Loading branch information
Showing
5 changed files
with
99 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
// ___________________________________________________ | ||
// | ||
// © Hi-Integrity Systems 2010. All rights reserved. | ||
// www.hisystems.com.au - Toby Wicks | ||
// ___________________________________________________ | ||
// | ||
|
||
using System.Collections; | ||
using System; | ||
using System.Data; | ||
|
||
namespace DatabaseObjects.SQL | ||
{ | ||
public enum LogicalOperator | ||
{ | ||
@And, | ||
@Or | ||
} | ||
|
||
public class SQLLogicalExpression : SQLExpression | ||
{ | ||
private SQLExpression left; | ||
private LogicalOperator @operator; | ||
private SQLExpression right; | ||
|
||
public SQLLogicalExpression() | ||
{ | ||
} | ||
|
||
public SQLLogicalExpression(SQLExpression leftExpression, LogicalOperator @operator, SQLExpression rightExpression) | ||
{ | ||
this.LeftExpression = leftExpression; | ||
this.@operator = @operator; | ||
this.RightExpression = rightExpression; | ||
} | ||
|
||
public SQLExpression LeftExpression | ||
{ | ||
get | ||
{ | ||
return this.left; | ||
} | ||
|
||
set | ||
{ | ||
if (value == null) | ||
throw new ArgumentNullException(); | ||
|
||
this.left = value; | ||
} | ||
} | ||
|
||
public SQLExpression RightExpression | ||
{ | ||
get | ||
{ | ||
return this.right; | ||
} | ||
|
||
set | ||
{ | ||
if (value == null) | ||
throw new ArgumentNullException(); | ||
|
||
this.right = value; | ||
} | ||
} | ||
|
||
public LogicalOperator Operator | ||
{ | ||
get | ||
{ | ||
return this.@operator; | ||
} | ||
|
||
set | ||
{ | ||
this.@operator = value; | ||
} | ||
} | ||
|
||
internal override string SQL(Serializers.Serializer serializer) | ||
{ | ||
return serializer.SerializeLogicalExpression(this); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters