Skip to content

Commit

Permalink
SQLConditionExpression inherits from SQLExpression. Closes #33.
Browse files Browse the repository at this point in the history
Condition expressions can now be utilised in other areas, allow for additional flexibility.
  • Loading branch information
hisystems committed Mar 6, 2012
1 parent d5dd0fc commit e6b0796
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions SQL/Select/SQLConditionExpression.vb
Expand Up @@ -12,6 +12,7 @@ Option Explicit On
Namespace SQL

Public Class SQLConditionExpression
Inherits SQLExpression

Private pobjLeftExpression As SQLExpression
Private peCompare As ComparisonOperator
Expand Down Expand Up @@ -82,13 +83,17 @@ Namespace SQL
End Set
End Property

Friend ReadOnly Property SQL(ByVal eConnectionType As Database.ConnectionType) As String
Get
Friend Overrides Function SQL(eConnectionType As Database.ConnectionType) As String

Return Condition(pobjLeftExpression, peCompare, pobjRightExpression, eConnectionType)
If pobjLeftExpression Is Nothing Then
Throw New InvalidOperationException("Left expression is not set")
ElseIf pobjRightExpression Is Nothing Then
Throw New InvalidOperationException("Right expression is not set")
End If

End Get
End Property
Return Condition(pobjLeftExpression, peCompare, pobjRightExpression, eConnectionType)

End Function

Private Function Condition( _
ByVal objLeftExpression As SQLExpression, _
Expand Down

0 comments on commit e6b0796

Please sign in to comment.