diff --git a/docs/docusaurus/docs/bpmn/ch04-API.md b/docs/docusaurus/docs/bpmn/ch04-API.md index 1fd11474888..d07b8951a02 100644 --- a/docs/docusaurus/docs/bpmn/ch04-API.md +++ b/docs/docusaurus/docs/bpmn/ch04-API.md @@ -102,7 +102,7 @@ There are two ways of querying data from the engine: the query API and native qu Sometimes you need more powerful queries, for example, queries using an OR operator or restrictions you cannot express using the Query API. For these cases, we have native queries, which allow you to write your own SQL queries. The return type is defined by the Query object you use and the data is mapped into the correct objects (Task, ProcessInstance, Execution, …​). Since the query will be fired at the database you have to use table and column names as they are defined in the database; this requires some knowledge about the internal data structure and it is recommended to use native queries with care. The table names can be retrieved through the API to keep the dependency as small as possible. List tasks = taskService.createNativeTaskQuery() - .sql("SELECT count(*) FROM " + managementService.getTableName(Task.class) + + .sql("SELECT * FROM " + managementService.getTableName(Task.class) + " T WHERE T.NAME_ = #{taskName}") .parameter("taskName", "gonzoTask") .list(); diff --git a/docs/userguide/src/zh_CN/bpmn/ch04-API.adoc b/docs/userguide/src/zh_CN/bpmn/ch04-API.adoc index 2ad15e0cd9e..250773f4ddd 100755 --- a/docs/userguide/src/zh_CN/bpmn/ch04-API.adoc +++ b/docs/userguide/src/zh_CN/bpmn/ch04-API.adoc @@ -112,7 +112,7 @@ List tasks = taskService.createTaskQuery() [source,java,linenums] ---- List tasks = taskService.createNativeTaskQuery() - .sql("SELECT count(*) FROM " + managementService.getTableName(Task.class) + + .sql("SELECT * FROM " + managementService.getTableName(Task.class) + " T WHERE T.NAME_ = #{taskName}") .parameter("taskName", "gonzoTask") .list();