3333
3434class GroupingTest {
3535 private static class Foo extends SqlTable {
36- public SqlColumn <Integer > A = column ("A" );
37- public SqlColumn <Integer > B = column ("B" );
38- public SqlColumn <Integer > C = column ("C" );
36+ public SqlColumn <Integer > columnA = column ("A" );
37+ public SqlColumn <Integer > columnB = column ("B" );
38+ public SqlColumn <Integer > columnC = column ("C" );
3939
4040 public Foo () {
4141 super ("Foo" );
4242 }
4343 }
4444
4545 private static final Foo foo = new Foo ();
46- private static final SqlColumn <Integer > A = foo .A ;
47- private static final SqlColumn <Integer > B = foo .B ;
48- private static final SqlColumn <Integer > C = foo .C ;
46+ private static final SqlColumn <Integer > columnA = foo .columnA ;
47+ private static final SqlColumn <Integer > columnB = foo .columnB ;
48+ private static final SqlColumn <Integer > columnC = foo .columnC ;
4949
5050 @ Test
5151 void testSimpleGrouping () {
52- SelectStatementProvider selectStatement = select (A , B , C )
52+ SelectStatementProvider selectStatement = select (columnA , columnB , columnC )
5353 .from (foo )
54- .where (A , isEqualTo (1 ), or (A , isEqualTo (2 )))
55- .and (B , isEqualTo (3 ))
54+ .where (columnA , isEqualTo (1 ), or (columnA , isEqualTo (2 )))
55+ .and (columnB , isEqualTo (3 ))
5656 .build ()
5757 .render (RenderingStrategies .MYBATIS3 );
5858
@@ -68,14 +68,14 @@ void testSimpleGrouping() {
6868
6969 @ Test
7070 void testComplexGrouping () {
71- SelectStatementProvider selectStatement = select (A , B , C )
71+ SelectStatementProvider selectStatement = select (columnA , columnB , columnC )
7272 .from (foo )
7373 .where (
74- group (A , isEqualTo (1 ), or (A , isGreaterThan (5 ))),
75- and (B , isEqualTo (1 )),
76- or (A , isLessThan (0 ), and (B , isEqualTo (2 )))
74+ group (columnA , isEqualTo (1 ), or (columnA , isGreaterThan (5 ))),
75+ and (columnB , isEqualTo (1 )),
76+ or (columnA , isLessThan (0 ), and (columnB , isEqualTo (2 )))
7777 )
78- .and (C , isEqualTo (1 ))
78+ .and (columnC , isEqualTo (1 ))
7979 .build ()
8080 .render (RenderingStrategies .MYBATIS3 );
8181
@@ -94,14 +94,14 @@ void testComplexGrouping() {
9494
9595 @ Test
9696 void testGroupAndExists () {
97- SelectStatementProvider selectStatement = select (A , B , C )
97+ SelectStatementProvider selectStatement = select (columnA , columnB , columnC )
9898 .from (foo )
9999 .where (
100- group (exists (select (foo .allColumns ()).from (foo ).where (A , isEqualTo (3 ))), and (A , isEqualTo (1 )), or (A , isGreaterThan (5 ))),
101- and (B , isEqualTo (1 )),
102- or (A , isLessThan (0 ), and (B , isEqualTo (2 )))
100+ group (exists (select (foo .allColumns ()).from (foo ).where (columnA , isEqualTo (3 ))), and (columnA , isEqualTo (1 )), or (columnA , isGreaterThan (5 ))),
101+ and (columnB , isEqualTo (1 )),
102+ or (columnA , isLessThan (0 ), and (columnB , isEqualTo (2 )))
103103 )
104- .and (C , isEqualTo (1 ))
104+ .and (columnC , isEqualTo (1 ))
105105 .build ()
106106 .render (RenderingStrategies .MYBATIS3 );
107107
@@ -121,14 +121,14 @@ void testGroupAndExists() {
121121
122122 @ Test
123123 void testNestedGrouping () {
124- SelectStatementProvider selectStatement = select (A , B , C )
124+ SelectStatementProvider selectStatement = select (columnA , columnB , columnC )
125125 .from (foo )
126126 .where (
127- group (group (A , isEqualTo (1 ), or (A , isGreaterThan (5 ))), and (A , isGreaterThan (5 ))),
128- and (group (A , isEqualTo (1 ), or (A , isGreaterThan (5 ))), or (B , isEqualTo (1 ))),
129- or (group (A , isEqualTo (1 ), or (A , isGreaterThan (5 ))), and (A , isLessThan (0 ), and (B , isEqualTo (2 ))))
127+ group (group (columnA , isEqualTo (1 ), or (columnA , isGreaterThan (5 ))), and (columnA , isGreaterThan (5 ))),
128+ and (group (columnA , isEqualTo (1 ), or (columnA , isGreaterThan (5 ))), or (columnB , isEqualTo (1 ))),
129+ or (group (columnA , isEqualTo (1 ), or (columnA , isGreaterThan (5 ))), and (columnA , isLessThan (0 ), and (columnB , isEqualTo (2 ))))
130130 )
131- .and (C , isEqualTo (1 ))
131+ .and (columnC , isEqualTo (1 ))
132132 .build ()
133133 .render (RenderingStrategies .MYBATIS3 );
134134
@@ -152,12 +152,12 @@ void testNestedGrouping() {
152152
153153 @ Test
154154 void testAndOrCriteriaGroups () {
155- SelectStatementProvider selectStatement = select (A , B , C )
155+ SelectStatementProvider selectStatement = select (columnA , columnB , columnC )
156156 .from (foo )
157- .where (A , isEqualTo (6 ))
158- .and (C , isEqualTo (1 ))
159- .and (group (A , isEqualTo (1 ), or (A , isGreaterThan (5 ))), or (B , isEqualTo (1 )))
160- .or (group (A , isEqualTo (1 ), or (A , isGreaterThan (5 ))), and (A , isLessThan (0 ), and (B , isEqualTo (2 ))))
157+ .where (columnA , isEqualTo (6 ))
158+ .and (columnC , isEqualTo (1 ))
159+ .and (group (columnA , isEqualTo (1 ), or (columnA , isGreaterThan (5 ))), or (columnB , isEqualTo (1 )))
160+ .or (group (columnA , isEqualTo (1 ), or (columnA , isGreaterThan (5 ))), and (columnA , isLessThan (0 ), and (columnB , isEqualTo (2 ))))
161161 .build ()
162162 .render (RenderingStrategies .MYBATIS3 );
163163
0 commit comments