|
5 | 5 | namespace dg.Sql |
6 | 6 | { |
7 | 7 | internal class JoinList : List<Join> { } |
| 8 | + |
8 | 9 | public class JoinColumnPair : WhereList |
9 | 10 | { |
10 | 11 | public const string RIGHT_TABLE_PLACEHOLDER_ID = @"__RIGHT_TABLE_PLACEHOLDER_ID__"; |
@@ -43,73 +44,237 @@ public JoinColumnPair(string leftTableNameOrAlias, string leftColumn, object val |
43 | 44 | this.Add(w); |
44 | 45 | } |
45 | 46 |
|
| 47 | + [Obsolete("Use AND")] |
46 | 48 | public JoinColumnPair JoinAND(TableSchema leftTableSchema, string leftColumn, string rightColumn) |
| 49 | + { |
| 50 | + return AND(leftTableSchema, leftColumn, rightColumn); |
| 51 | + } |
| 52 | + |
| 53 | + [Obsolete("Use AND")] |
| 54 | + public JoinColumnPair JoinAND(string leftTableNameOrAlias, string leftColumn, string rightColumn) |
| 55 | + { |
| 56 | + return AND(leftTableNameOrAlias, leftColumn, rightColumn); |
| 57 | + } |
| 58 | + |
| 59 | + [Obsolete("Use AND")] |
| 60 | + public JoinColumnPair JoinAND(object value, string rightColumn) |
| 61 | + { |
| 62 | + return AND(value, rightColumn); |
| 63 | + } |
| 64 | + |
| 65 | + [Obsolete("Use AND")] |
| 66 | + public JoinColumnPair JoinAND(object value, bool literalValue, string rightColumn) |
| 67 | + { |
| 68 | + return AND(value, literalValue, rightColumn); |
| 69 | + } |
| 70 | + |
| 71 | + [Obsolete("Use AND")] |
| 72 | + public JoinColumnPair JoinAND(string leftTableNameOrAlias, string leftColumn, object value, bool literalValue) |
| 73 | + { |
| 74 | + return AND(leftTableNameOrAlias, leftColumn, value, literalValue); |
| 75 | + } |
| 76 | + |
| 77 | + [Obsolete("Use OR")] |
| 78 | + public JoinColumnPair JoinOR(TableSchema leftTableSchema, string leftColumn, string rightColumn) |
| 79 | + { |
| 80 | + return OR(leftTableSchema, leftColumn, rightColumn); |
| 81 | + } |
| 82 | + |
| 83 | + [Obsolete("Use OR")] |
| 84 | + public JoinColumnPair JoinOR(string leftTableNameOrAlias, string leftColumn, string rightColumn) |
| 85 | + { |
| 86 | + return OR(leftTableNameOrAlias, leftColumn, rightColumn); |
| 87 | + } |
| 88 | + |
| 89 | + [Obsolete("Use OR")] |
| 90 | + public JoinColumnPair JoinOR(object value, string rightColumn) |
| 91 | + { |
| 92 | + return OR(value, rightColumn); |
| 93 | + } |
| 94 | + |
| 95 | + [Obsolete("Use OR")] |
| 96 | + public JoinColumnPair JoinOR(object value, bool literalValue, string rightColumn) |
| 97 | + { |
| 98 | + return OR(value, literalValue, rightColumn); |
| 99 | + } |
| 100 | + |
| 101 | + [Obsolete("Use OR")] |
| 102 | + public JoinColumnPair JoinOR(string leftTableNameOrAlias, string leftColumn, object value, bool literalValue) |
| 103 | + { |
| 104 | + return OR(leftTableNameOrAlias, leftColumn, value, literalValue); |
| 105 | + } |
| 106 | + |
| 107 | + public JoinColumnPair AND(TableSchema leftTableSchema, string leftColumn, string rightColumn) |
47 | 108 | { |
48 | 109 | this.Add(new Where(WhereCondition.AND, leftTableSchema.Name, leftColumn, WhereComparison.EqualsTo, RIGHT_TABLE_PLACEHOLDER_ID, rightColumn)); |
49 | 110 | return this; |
50 | 111 | } |
51 | 112 |
|
52 | | - public JoinColumnPair JoinAND(string leftTableNameOrAlias, string leftColumn, string rightColumn) |
| 113 | + public JoinColumnPair AND(string leftTableNameOrAlias, string leftColumn, string rightColumn) |
53 | 114 | { |
54 | 115 | this.Add(new Where(WhereCondition.AND, leftTableNameOrAlias, leftColumn, WhereComparison.EqualsTo, RIGHT_TABLE_PLACEHOLDER_ID, rightColumn)); |
55 | 116 | return this; |
56 | 117 | } |
57 | 118 |
|
58 | | - public JoinColumnPair JoinAND(object value, string rightColumn) |
| 119 | + public JoinColumnPair AND(object value, string rightColumn) |
59 | 120 | { |
60 | 121 | this.Add(new Where(WhereCondition.AND, RIGHT_TABLE_PLACEHOLDER_ID, rightColumn, WhereComparison.EqualsTo, value)); |
61 | 122 | return this; |
62 | 123 | } |
63 | 124 |
|
64 | | - public JoinColumnPair JoinAND(object value, bool literalValue, string rightColumn) |
| 125 | + public JoinColumnPair AND(object value, bool literalValue, string rightColumn) |
65 | 126 | { |
66 | 127 | Where w = new Where(WhereCondition.AND, RIGHT_TABLE_PLACEHOLDER_ID, rightColumn, WhereComparison.EqualsTo, value); |
67 | 128 | if (literalValue) w.SecondType = ValueObjectType.Literal; |
68 | 129 | this.Add(w); |
69 | 130 | return this; |
70 | 131 | } |
71 | | - public JoinColumnPair JoinAND(string leftTableNameOrAlias, string leftColumn, object value, bool literalValue) |
| 132 | + |
| 133 | + public JoinColumnPair AND(string leftTableNameOrAlias, string leftColumn, object value, bool literalValue) |
72 | 134 | { |
73 | 135 | Where w = new Where(WhereCondition.AND, leftTableNameOrAlias, leftColumn, WhereComparison.EqualsTo, value); |
74 | 136 | if (literalValue) w.SecondType = ValueObjectType.Literal; |
75 | 137 | this.Add(w); |
76 | 138 | return this; |
77 | 139 | } |
78 | 140 |
|
79 | | - public JoinColumnPair JoinOR(TableSchema leftTableSchema, string leftColumn, string rightColumn) |
| 141 | + public new JoinColumnPair AND(object thisObject, ValueObjectType thisObjectType, WhereComparison comparison, object thatObject, ValueObjectType thatObjectType) |
| 142 | + { |
| 143 | + base.AND(thisObject, thisObjectType, comparison, thatObject, thatObjectType); |
| 144 | + return this; |
| 145 | + } |
| 146 | + |
| 147 | + public new JoinColumnPair AND(IPhrase phrase) |
| 148 | + { |
| 149 | + base.AND(phrase); |
| 150 | + return this; |
| 151 | + } |
| 152 | + |
| 153 | + public new JoinColumnPair AND(IPhrase phrase, WhereComparison comparison, object value) |
| 154 | + { |
| 155 | + base.AND(phrase, comparison, value); |
| 156 | + return this; |
| 157 | + } |
| 158 | + |
| 159 | + public new JoinColumnPair AND(IPhrase phrase, WhereComparison comparison, object value, ValueObjectType valueType) |
| 160 | + { |
| 161 | + base.AND(phrase, comparison, value, valueType); |
| 162 | + return this; |
| 163 | + } |
| 164 | + |
| 165 | + public new JoinColumnPair AND(IPhrase phrase, WhereComparison comparison, string tableName, string columnName) |
| 166 | + { |
| 167 | + base.AND(phrase, comparison, tableName, columnName); |
| 168 | + return this; |
| 169 | + } |
| 170 | + |
| 171 | + public new JoinColumnPair AND(WhereList whereList) |
| 172 | + { |
| 173 | + base.AND(whereList); |
| 174 | + return this; |
| 175 | + } |
| 176 | + |
| 177 | + public new JoinColumnPair AND(string tableName, string columnName, WhereComparison comparison, object columnValue) |
| 178 | + { |
| 179 | + base.AND(tableName, columnName, comparison, columnValue); |
| 180 | + return this; |
| 181 | + } |
| 182 | + |
| 183 | + public new JoinColumnPair AND(string tableName, string columnName, WhereComparison comparison, string otherTableName, string otherColumnName) |
| 184 | + { |
| 185 | + base.AND(tableName, columnName, comparison, otherTableName, otherColumnName); |
| 186 | + return this; |
| 187 | + } |
| 188 | + |
| 189 | + public JoinColumnPair OR(TableSchema leftTableSchema, string leftColumn, string rightColumn) |
80 | 190 | { |
81 | 191 | this.Add(new Where(WhereCondition.OR, leftTableSchema.Name, leftColumn, WhereComparison.EqualsTo, RIGHT_TABLE_PLACEHOLDER_ID, rightColumn)); |
82 | 192 | return this; |
83 | 193 | } |
84 | 194 |
|
85 | | - public JoinColumnPair JoinOR(string leftTableNameOrAlias, string leftColumn, string rightColumn) |
| 195 | + public JoinColumnPair OR(string leftTableNameOrAlias, string leftColumn, string rightColumn) |
86 | 196 | { |
87 | 197 | this.Add(new Where(WhereCondition.OR, leftTableNameOrAlias, leftColumn, WhereComparison.EqualsTo, RIGHT_TABLE_PLACEHOLDER_ID, rightColumn)); |
88 | 198 | return this; |
89 | 199 | } |
90 | 200 |
|
91 | | - public JoinColumnPair JoinOR(object value, string rightColumn) |
| 201 | + public JoinColumnPair OR(object value, string rightColumn) |
92 | 202 | { |
93 | 203 | this.Add(new Where(WhereCondition.OR, RIGHT_TABLE_PLACEHOLDER_ID, rightColumn, WhereComparison.EqualsTo, value)); |
94 | 204 | return this; |
95 | 205 | } |
96 | 206 |
|
97 | | - public JoinColumnPair JoinOR(object value, bool literalValue, string rightColumn) |
| 207 | + public JoinColumnPair OR(object value, bool literalValue, string rightColumn) |
98 | 208 | { |
99 | 209 | Where w = new Where(WhereCondition.OR, RIGHT_TABLE_PLACEHOLDER_ID, rightColumn, WhereComparison.EqualsTo, value); |
100 | 210 | if (literalValue) w.SecondType = ValueObjectType.Literal; |
101 | 211 | this.Add(w); |
102 | 212 | return this; |
103 | 213 | } |
104 | 214 |
|
105 | | - public JoinColumnPair JoinOR(string leftTableNameOrAlias, string leftColumn, object value, bool literalValue) |
| 215 | + public JoinColumnPair OR(string leftTableNameOrAlias, string leftColumn, object value, bool literalValue) |
106 | 216 | { |
107 | 217 | Where w = new Where(WhereCondition.OR, leftTableNameOrAlias, leftColumn, WhereComparison.EqualsTo, value); |
108 | 218 | if (literalValue) w.SecondType = ValueObjectType.Literal; |
109 | 219 | this.Add(w); |
110 | 220 | return this; |
111 | 221 | } |
| 222 | + |
| 223 | + public new JoinColumnPair OR(object thisObject, ValueObjectType thisObjectType, WhereComparison comparison, object thatObject, ValueObjectType thatObjectType) |
| 224 | + { |
| 225 | + base.OR(thisObject, thisObjectType, comparison, thatObject, thatObjectType); |
| 226 | + return this; |
| 227 | + } |
| 228 | + |
| 229 | + public new JoinColumnPair OR(string columnName, WhereComparison comparison, object columnValue) |
| 230 | + { |
| 231 | + base.OR(columnName, comparison, columnValue); |
| 232 | + return this; |
| 233 | + } |
| 234 | + |
| 235 | + public new JoinColumnPair OR(IPhrase phrase) |
| 236 | + { |
| 237 | + base.OR(phrase); |
| 238 | + return this; |
| 239 | + } |
| 240 | + |
| 241 | + public new JoinColumnPair OR(IPhrase phrase, WhereComparison comparison, object value) |
| 242 | + { |
| 243 | + base.OR(phrase, comparison, value); |
| 244 | + return this; |
| 245 | + } |
| 246 | + |
| 247 | + public new JoinColumnPair OR(IPhrase phrase, WhereComparison comparison, object value, ValueObjectType valueType) |
| 248 | + { |
| 249 | + base.OR(phrase, comparison, value, valueType); |
| 250 | + return this; |
| 251 | + } |
| 252 | + |
| 253 | + public new JoinColumnPair OR(IPhrase phrase, WhereComparison comparison, string tableName, string columnName) |
| 254 | + { |
| 255 | + base.OR(phrase, comparison, tableName, columnName); |
| 256 | + return this; |
| 257 | + } |
| 258 | + |
| 259 | + public new JoinColumnPair OR(WhereList whereList) |
| 260 | + { |
| 261 | + base.OR(whereList); |
| 262 | + return this; |
| 263 | + } |
| 264 | + |
| 265 | + public new JoinColumnPair OR(string tableName, string columnName, WhereComparison comparison, object columnValue) |
| 266 | + { |
| 267 | + base.OR(tableName, columnName, comparison, columnValue); |
| 268 | + return this; |
| 269 | + } |
| 270 | + |
| 271 | + public new JoinColumnPair OR(string tableName, string columnName, WhereComparison comparison, string otherTableName, string otherColumnName) |
| 272 | + { |
| 273 | + base.OR(tableName, columnName, comparison, otherTableName, otherColumnName); |
| 274 | + return this; |
| 275 | + } |
112 | 276 | } |
| 277 | + |
113 | 278 | internal class Join |
114 | 279 | { |
115 | 280 | private JoinType _JoinType; |
|
0 commit comments