File tree Expand file tree Collapse file tree 1 file changed +4
-26
lines changed Expand file tree Collapse file tree 1 file changed +4
-26
lines changed Original file line number Diff line number Diff 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-
5939See [ Criteria API] ( https://doma.readthedocs.io/en/latest/criteria-api/ )
6040for more information.
6141
6242### SQL templates
6343
64- Written in Java:
65-
6644``` java
6745@Dao
6846public interface EmployeeDao {
You can’t perform that action at this time.
0 commit comments