File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -654,6 +654,27 @@ The above query issues the following SQL statement:
654654 Tips
655655====
656656
657+ Execution in Dao (Entityql, NativeSql)
658+ --------------------------------------
659+
660+ It is useful to execute DSLs in the default method of the Dao interface.
661+ To get a ``config `` object, call ``Config.get(this) `` in the default method as follows:
662+
663+ .. code-block :: java
664+
665+ @Dao
666+ public interface EmployeeDao {
667+
668+ default Optional<Employee > selectById (Integer id ) {
669+ Employee_ e = new Employee_ ();
670+ List<Employee > list =
671+ Entityql . from(e)
672+ .where(c - > c. eq(e. employeeId, id))
673+ .execute(Config . get(this ));
674+ return list. stream(). findFirst();
675+ }
676+ }
677+
657678 The use of the select method (NativeSql)
658679----------------------------------------
659680
You can’t perform that action at this time.
0 commit comments