@@ -23,7 +23,7 @@ We need to insert a single record to the table.
2323movieStore
2424 .insert()
2525 .values(new Movie(null, "Inception", "Christopher Nolan"))
26- .execute();
26+ .execute(dataSource );
2727```
2828
2929We need to insert multiple records to the table.
@@ -46,7 +46,7 @@ movieStore
4646 new Movie (null , " Fight Club" , " David Fincher" ),
4747 new Movie (null , " Interstellar" , " Christopher Nolan" ),
4848 new Movie (null , " The Social Network" , " David Fincher" ))
49- .execute();
49+ .execute(dataSource );
5050```
5151
5252We need to insert a single record to the table and return inserted value.
@@ -65,7 +65,7 @@ We need to select all the movies
6565``` java
6666List<Movie > movies = movieStore
6767 .select()
68- .execute();
68+ .execute(dataSource );
6969```
7070
7171We need to select the movies with where clause
@@ -74,7 +74,25 @@ We need to select the movies with where clause
7474List<Movie > movies = movieStore
7575 .select()
7676 .where(directedBy(). eq(" Christopher Nolan" ))
77- .execute();
77+ .execute(dataSource);
78+ ```
79+
80+ We need to select a movie by primary key (id columns)
81+
82+ ``` java
83+ Movie movie = movieStore
84+ .select()
85+ .execute(dataSource);
86+ ```
87+
88+
89+ We need to select a movie by primary key (id columns) with where clause
90+
91+ ``` java
92+ Movie movie = movieStore
93+ .select()
94+ .where(directedBy(). eq(" Christopher Nolan" ))
95+ .execute(dataSource);
7896```
7997
8098## Update
@@ -90,7 +108,7 @@ movieStore
90108 .update()
91109 .set(new Movie (null , " Fight Club" , " Martyn Scorsese" ))
92110 .where(title(). eq(" Fight Club" ))
93- .execute();
111+ .execute(dataSource );
94112```
95113
96114Update a record with multiple where clause
@@ -106,7 +124,7 @@ movieStore
106124 .where(
107125 id(). eq(1 ). and()
108126 .title(). eq(" Fight Club" ))
109- .execute();
127+ .execute(dataSource );
110128```
111129
112130Update a record with multiple where clause amd selected columns
@@ -119,7 +137,7 @@ movieStore
119137 .update()
120138 .set(directedBy(" Martyn Scorsese" ))
121139 .where(id(). eq(1 ). and(). title(). eq(" Fight Club" ))
122- .execute();
140+ .execute(dataSource );
123141```
124142
125143
@@ -130,6 +148,15 @@ Delete all the records in the table
130148``` java
131149movieStore
132150 .delete()
133- .execute();
151+ .execute(dataSource );
134152```
135153
154+
155+ We need to delete the movies with where clause
156+
157+ ``` java
158+ movieStore
159+ .delete()
160+ .where(directedBy(). eq(" Christopher Nolan" ))
161+ .execute(dataSource);
162+ ```
0 commit comments