Skip to content

Commit 722286e

Browse files
committed
Expectation Of Update
1 parent fd14f59 commit 722286e

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

content/docs/guides/table.md

+20-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ From here you can execute SQL Statements against the table as follows
1717
We need to insert a single record to the table.
1818

1919
```java
20+
// INSERT INTO movie VALUES('Inception', 'Christopher Nolan')
2021
movieStore
2122
.insert()
2223
.values(new Movie(null, "Inception", "Christopher Nolan"))
@@ -67,16 +68,34 @@ List<Movie> movies = movieStore
6768

6869
## Update
6970

70-
Update a record
71+
Update a record with where clause
7172

7273
```java
74+
75+
// UPDATE movie
76+
// SET title='Fight Club', directed_by='Martyn Scorsese'
77+
// WHERE title='Fight Club'
7378
movieStore
7479
.update()
7580
.set(new Movie(null, "Fight Club", "Martyn Scorsese"))
7681
.where(title().eq("Fight Club"))
7782
.execute();
7883
```
7984

85+
Update a record with multiple where clause
86+
87+
```java
88+
89+
// UPDATE movie
90+
// SET title='Fight Club', directed_by='Martyn Scorsese'
91+
// WHERE id=1 AND title='Fight Club'
92+
movieStore
93+
.update()
94+
.set(new Movie(null, "Fight Club", "Martyn Scorsese"))
95+
.where(id().eq(1).and().title().eq("Fight Club"))
96+
.execute();
97+
```
98+
8099
## Delete
81100

82101
Delete all the records in the table

0 commit comments

Comments
 (0)