Using both TaskQuery and NativeTaskQuery

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-30-2013 04:08 AM
Hi,
Is there any way that i can use createTaskQuery and createNativeTaskQuery for the same taskService Object?
Like:
TaskService taskService = engine.getTaskService();
taskService.createNativeTaskQuery().sql("select * from "+managementService.getTableName(Task.class)+" T where T.name_ ilike #{taskName}").parameter("taskName", "user task").list();
taskService.createTaskQuery().suspended();
The objective is to get the tasks with name 'User Task' that are suspended..
Note: Why i use createNativeTaskQuery is that i use postgres database which does not support in-case sensitive search for taskQuery.taskNameLike
Currently, it is returning the tasks returned by taskQuery not nativetaskquery.
Can u suggest me a way.
–
Thanks and Regards,
Arun.C…
Is there any way that i can use createTaskQuery and createNativeTaskQuery for the same taskService Object?
Like:
TaskService taskService = engine.getTaskService();
taskService.createNativeTaskQuery().sql("select * from "+managementService.getTableName(Task.class)+" T where T.name_ ilike #{taskName}").parameter("taskName", "user task").list();
taskService.createTaskQuery().suspended();
The objective is to get the tasks with name 'User Task' that are suspended..
Note: Why i use createNativeTaskQuery is that i use postgres database which does not support in-case sensitive search for taskQuery.taskNameLike
Currently, it is returning the tasks returned by taskQuery not nativetaskquery.
Can u suggest me a way.
–
Thanks and Regards,
Arun.C…
Labels:
- Labels:
-
Archive
3 REPLIES 3
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-03-2013 03:38 AM
Don't really see what your problem is. Do you want to combine UserTasks from TaskQuery and NatvieTaskQuery? Why not include the SQL you need (the SQL generated by suspended()) in the NativeQuery?

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-11-2013 06:13 AM
If i m using SQLs instead of API, will there be any changes in performance?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-15-2013 03:55 AM
No, in the end the API is just a wrapper around the SQL calls.
