Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit a23bc80

Browse files
committed
Add a description of the QueryDsl.of() method
1 parent 671f010 commit a23bc80

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

docs/query-dsl.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1765,6 +1765,20 @@ To obtain a ``config`` object, call ``Config.get(this)`` within the default meth
17651765
}
17661766
}
17671767
1768+
You can also use ``QueryDsl.of(this)`` as a shortcut for ``new QueryDsl(Config.get(this))``.
1769+
1770+
.. code-block:: java
1771+
1772+
@Dao
1773+
public interface EmployeeDao {
1774+
1775+
default Optional<Employee> selectById(Integer id) {
1776+
Employee_ e = new Employee_();
1777+
return QueryDsl.of(this).from(e).where(c -> c.eq(e.employeeId, id)).fetchOptional();
1778+
}
1779+
}
1780+
1781+
17681782
Overwriting the Table Name
17691783
--------------------------
17701784

0 commit comments

Comments
 (0)