Skip to content

Commit 1772863

Browse files
committed
UPDATE sample code
1 parent 3a83634 commit 1772863

File tree

1 file changed

+4
-26
lines changed

1 file changed

+4
-26
lines changed

README.md

Lines changed: 4 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,12 @@ Examples
2020

2121
### Type-safe Criteria API
2222

23-
Written in Java:
24-
2523
```java
26-
Entityql entityql = new Entityql(config);
27-
Employee_ e = new Employee_();
28-
Department_ d = new Department_();
24+
var entityql = new Entityql(config);
25+
var e = new Employee_();
26+
var d = new Department_();
2927

30-
List<Employee> list = entityql
28+
var employees = entityql
3129
.from(e)
3230
.innerJoin(d, on -> on.eq(e.departmentId, d.departmentId))
3331
.where(c -> c.eq(d.departmentName, "SALES"))
@@ -38,31 +36,11 @@ List<Employee> list = entityql
3836
.fetch();
3937
```
4038

41-
Written in Kotlin:
42-
43-
```kotlin
44-
val entityql = KEntityql(config)
45-
val e = Employee_()
46-
val d = Department_()
47-
48-
val list = entityql
49-
.from(e)
50-
.innerJoin(d) { eq(e.departmentId, d.departmentId) }
51-
.where { eq(d.departmentName, "SALES") }
52-
.associate(e, d) { employee, department ->
53-
employee.department = department
54-
department.employeeList += employee
55-
}
56-
.fetch()
57-
```
58-
5939
See [Criteria API](https://doma.readthedocs.io/en/latest/criteria-api/)
6040
for more information.
6141

6242
### SQL templates
6343

64-
Written in Java:
65-
6644
```java
6745
@Dao
6846
public interface EmployeeDao {

0 commit comments

Comments
 (0)