Skip to content

Commit 8dcade0

Browse files
committedNov 7, 2024
API ChANGES
1 parent 70e5090 commit 8dcade0

File tree

2 files changed

+36
-9
lines changed

2 files changed

+36
-9
lines changed
 

‎content/docs/guides/table.md

+35-8
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ We need to insert a single record to the table.
2323
movieStore
2424
.insert()
2525
.values(new Movie(null, "Inception", "Christopher Nolan"))
26-
.execute();
26+
.execute(dataSource);
2727
```
2828
2929
We 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

5252
We 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
6666
List<Movie> movies = movieStore
6767
.select()
68-
.execute();
68+
.execute(dataSource);
6969
```
7070

7171
We need to select the movies with where clause
@@ -74,7 +74,25 @@ We need to select the movies with where clause
7474
List<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

96114
Update 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

112130
Update 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
131149
movieStore
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+
```

‎content/docs/guides/view.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ MovieView movieView = DataManager.getManager().getMovieView();
1515
We can refresh Materialized View
1616

1717
```java
18-
movieView.refresh;
18+
movieView.refresh(dataSource);
1919
```

0 commit comments

Comments
 (0)