@@ -32,7 +32,7 @@ public static void main(final String[] args) throws Exception {
32
32
33
33
void mainStart (Connection dbConnection ) throws Exception {
34
34
try (SqlParamBuilder builder = new SqlParamBuilder (dbConnection )) {
35
- // CREATE TABLE:
35
+ System . out . println ( "# CREATE TABLE" );
36
36
builder .sql ("""
37
37
CREATE TABLE employee
38
38
( id INTEGER PRIMARY KEY
@@ -42,7 +42,7 @@ void mainStart(Connection dbConnection) throws Exception {
42
42
)""" )
43
43
.execute ();
44
44
45
- // SINGLE INSERT:
45
+ System . out . println ( "# SINGLE INSERT" );
46
46
builder .sql ("""
47
47
INSERT INTO employee
48
48
( id, code, created ) VALUES
@@ -53,7 +53,7 @@ void mainStart(Connection dbConnection) throws Exception {
53
53
.bind ("created" , someDate )
54
54
.execute ();
55
55
56
- // MULTI INSERT:
56
+ System . out . println ( "# MULTI INSERT" );
57
57
builder .sql ("""
58
58
INSERT INTO employee
59
59
(id,code,created) VALUES
@@ -63,14 +63,14 @@ void mainStart(Connection dbConnection) throws Exception {
63
63
.bind ("id1" , 2 )
64
64
.bind ("id2" , 3 )
65
65
.bind ("code" , "T" )
66
- .bind ("created" , someDate .plusDays (1 ))
66
+ .bind ("created" , someDate .plusDays (7 ))
67
67
.execute ();
68
68
builder .bind ("id1" , 11 )
69
69
.bind ("id2" , 12 )
70
70
.bind ("code" , "V" )
71
71
.execute ();
72
72
73
- // SELECT 1:
73
+ System . out . println ( "# SELECT" );
74
74
List <Employee > employees = builder .sql ("""
75
75
SELECT t.id, t.name, t.created
76
76
FROM employee t
@@ -91,7 +91,7 @@ AND t.code IN (:code)
91
91
assertEquals ("test" , employees .get (0 ).name );
92
92
assertEquals (someDate , employees .get (0 ).created );
93
93
94
- // REUSE THE SELECT:
94
+ System . out . println ( "# REUSE THE SELECT\n " );
95
95
List <Employee > employees2 = builder
96
96
.bind ("id" , 100 )
97
97
.streamMap (rs -> new Employee (
@@ -100,6 +100,7 @@ AND t.code IN (:code)
100
100
rs .getObject (3 , LocalDate .class )))
101
101
.toList ();
102
102
assertEquals (5 , employees2 .size ());
103
+ employees2 .stream ().forEach (System .out ::println );
103
104
}
104
105
}
105
106
0 commit comments