@@ -17,7 +17,9 @@ From here you can execute SQL Statements against the table as follows
1717We need to insert a single record to the table.
1818
1919``` java
20- // INSERT INTO movie VALUES('Inception', 'Christopher Nolan')
20+ /* * INSERT INTO movie
21+ * VALUES('Inception', 'Christopher Nolan')
22+ * /
2123movieStore
2224 .insert()
2325 .values(new Movie(null, "Inception", "Christopher Nolan"))
@@ -28,8 +30,8 @@ We need to insert multiple records to the table.
2830
2931```
3032/**
31- INSERT INTO movie (title, directed_by) VALUES
32- ('Pulp Fiction', 'Quentin Tarantino'),
33+ INSERT INTO movie (title, directed_by)
34+ VALUES ('Pulp Fiction', 'Quentin Tarantino'),
3335 ('The Matrix', 'Lana Wachowski'),
3436 ('Dunkirk', 'Christopher Nolan'),
3537 ('Fight Club', 'David Fincher'),
@@ -38,12 +40,12 @@ INSERT INTO movie (title, directed_by) VALUES
3840*/
3941movieStore
4042 .insert()
41- . values(new Movie(null, "Pulp Fiction", "Quentin Tarantino"))
42- .values( new Movie(null, "The Matrix", "Lana Wachowski") )
43- .values( new Movie(null, "Dunkirk", "Christopher Nolan"))
44- .values( new Movie(null, "Fight Club", "David Fincher"))
45- .values( new Movie(null, "Interstellar", "Christopher Nolan"))
46- .values( new Movie(null, "The Social Network", "David Fincher"))
43+ values(new Movie (null , " Pulp Fiction" , " Quentin Tarantino" ),
44+ new Movie (null , " The Matrix" , " Lana Wachowski" )
45+ new Movie (null , " Dunkirk" , " Christopher Nolan" ),
46+ new Movie (null , " Fight Club" , " David Fincher" ),
47+ new Movie (null , " Interstellar" , " Christopher Nolan" ),
48+ new Movie (null , " The Social Network" , " David Fincher" ))
4749 .execute();
4850```
4951
@@ -100,15 +102,16 @@ Update a record with multiple where clause
100102// WHERE id=1 AND title='Fight Club'
101103movieStore
102104 .update()
103- .set(new Movie (null , " Blood Diamond" , " Martyn Scorsese" ))
104- .where(id(). eq(1 ). and(). title(). eq(" Fight Club" ))
105+ .set(new Movie (null , " Blood Diamond" , " Martyn Scorsese" ))
106+ .where(
107+ id(). eq(1 ). and()
108+ .title(). eq(" Fight Club" ))
105109 .execute();
106110```
107111
108112Update a record with multiple where clause amd selected columns
109113
110114``` java
111-
112115// UPDATE movie
113116// SET directed_by='Martyn Scorsese'
114117// WHERE id=1 AND title='Fight Club'
0 commit comments