[jboss-jira] [JBoss JIRA] Created: (JBRULES-3202) named query TasksAssignedAsPotentialOwner doesn't work with MySql db
Frank23 Knoll23 (JIRA)
jira-events at lists.jboss.org
Tue Sep 6 04:18:26 EDT 2011
named query TasksAssignedAsPotentialOwner doesn't work with MySql db
---------------------------------------------------------------------
Key: JBRULES-3202
URL: https://issues.jboss.org/browse/JBRULES-3202
Project: Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Environment: MYSQL database
Reporter: Frank23 Knoll23
Assignee: Mark Proctor
Hi,
When I add a task (having two potential owners) by calling the method addTask followed by calling the method getTasksAssignedAsPotentialOwner of org.jbpm.task.service.TaskClient I expect to receive a list of TaskSummaries containing at least the previously added task. But I actually get an empty list!
Here is my setup and possible solution:
I am using the trunk version of ./jbpm-human-task/src/main/resources/META-INF/orm.xml and a MYSQL database.
When calling addTask the Task table will be populated with a NULL actualOwner_id.
The named query TasksAssignedAsPotentialOwner
"select new org.jbpm.task.query.TaskSummary(...t.taskData.actualOwner...) from ... left join t.taskData.actualOwner ..." of orm.xml generates SQL consisting of an inner join "inner join OrganizationalEntity user7_ on task0_.actualOwner_id=user7_.id" which doesn't take the NULL actualOwner_id correctly into account.
When I replace the named query TasksAssignedAsPotentialOwner with
"select new org.jbpm.task.query.TaskSummary(...actualOwner...) from ...left join t.taskData.actualOwner as actualOwner ...", then the generated SQL consists of an "left outer join OrganizationalEntity user2_ on task0_.actualOwner_id=user2_.id" which takes the NULL actualOwner_id correctly into account. So I get a List of TaskSummaries containing the added task.
Is this a correct fix?
Cheers, Frank
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list