Index: orm.xml =================================================================== --- orm.xml (revision 29905) +++ orm.xml (working copy) @@ -2,10 +2,10 @@ + version="1.0"> -select +select new org.drools.task.query.TaskSummary( t.id, names.text, @@ -19,32 +19,38 @@ t.taskData.createdOn, t.taskData.activationTime, t.taskData.expirationTime) -from +from Task t left join t.taskData.createdBy, I18NText names, I18NText subjects, - I18NText descriptions, + I18NText descriptions, OrganizationalEntity businessAdministrator -where +where businessAdministrator.id = :userId and - businessAdministrator in elements ( t.peopleAssignments.businessAdministrators ) and - + businessAdministrator in elements ( t.peopleAssignments.businessAdministrators ) and + names.language = :language and names in elements( t.names) and - + + ( subjects.language = :language and - subjects in elements( t.subjects) and - + subjects in elements( t.subjects) + or t.subjects.size = 0 + ) and + + ( descriptions.language = :language and - descriptions in elements( t.descriptions) and - - t.taskData.expirationTime is null + descriptions in elements( t.descriptions) + or t.descriptions.size = 0 + ) and + + t.taskData.expirationTime is null - + -select +select new org.drools.task.query.TaskSummary( t.id, names.text, @@ -58,32 +64,38 @@ t.taskData.createdOn, t.taskData.activationTime, t.taskData.expirationTime) -from +from Task t left join t.taskData.createdBy, I18NText names, I18NText subjects, - I18NText descriptions, + I18NText descriptions, OrganizationalEntity excludedOwners -where +where excludedOwners.id = :userId and - excludedOwners in elements ( t.peopleAssignments.excludedOwners ) and - + excludedOwners in elements ( t.peopleAssignments.excludedOwners ) and + names.language = :language and names in elements( t.names) and - + + ( subjects.language = :language and - subjects in elements( t.subjects) and - + subjects in elements( t.subjects) + or t.subjects.size = 0 + ) and + + ( descriptions.language = :language and - descriptions in elements( t.descriptions) and - - t.taskData.expirationTime is null + descriptions in elements( t.descriptions) + or t.descriptions.size = 0 + ) and + + t.taskData.expirationTime is null -select +select new org.drools.task.query.TaskSummary( t.id, names.text, @@ -97,29 +109,38 @@ t.taskData.createdOn, t.taskData.activationTime, t.taskData.expirationTime) -from +from Task t left join t.taskData.createdBy left join t.taskData.actualOwner left join t.subjects as subject, I18NText names, - I18NText descriptions, + I18NText descriptions, OrganizationalEntity potentialOwners -where +where potentialOwners.id = :userId and - potentialOwners in elements ( t.peopleAssignments.potentialOwners ) and - + potentialOwners in elements ( t.peopleAssignments.potentialOwners ) and + names.language = :language and names in elements( t.names) and - - subject.language = :language and - + + ( + subject.language = :language + or t.subjects.size = 0 + ) and + + ( descriptions.language = :language and - descriptions in elements( t.descriptions) and - + descriptions in elements( t.descriptions) + or t.descriptions.size = 0 + ) and + + + + t.taskData.status in ('Created', 'Ready', 'Reserved', 'InProgress', 'Suspended') and - - t.taskData.expirationTime is null + + t.taskData.expirationTime is null @@ -152,11 +173,18 @@ names.language = :language and names in elements( t.names) and + + ( subjects.language = :language and - subjects in elements( t.subjects) and + subjects in elements( t.subjects) + or t.subjects.size = 0 + ) and + ( descriptions.language = :language and - descriptions in elements( t.descriptions) and + descriptions in elements( t.descriptions) + or t.descriptions.size = 0 + ) and t.taskData.status in ('Created', 'Ready', 'Reserved', 'InProgress', 'Suspended') and @@ -194,11 +222,17 @@ names.language = :language and names in elements( t.names) and + ( subjects.language = :language and - subjects in elements( t.subjects) and + subjects in elements( t.subjects) + or t.subjects.size = 0 + ) and + ( descriptions.language = :language and - descriptions in elements( t.descriptions) and + descriptions in elements( t.descriptions) + or t.descriptions.size = 0 + ) and t.taskData.status in ('Created', 'Ready', 'Reserved', 'InProgress', 'Suspended') and @@ -237,11 +271,17 @@ names.language = :language and names in elements( t.names) and + ( subjects.language = :language and - subjects in elements( t.subjects) and + subjects in elements( t.subjects) + or t.subjects.size = 0 + ) and + ( descriptions.language = :language and - descriptions in elements( t.descriptions) and + descriptions in elements( t.descriptions) + or t.descriptions.size = 0 + ) and t.taskData.status in ('Created', 'Ready', 'Reserved', 'InProgress', 'Suspended') and @@ -277,11 +317,17 @@ names.language = :language and names in elements( t.names) and + ( subjects.language = :language and - subjects in elements( t.subjects) and + subjects in elements( t.subjects) + or t.subjects.size = 0 + ) and + ( descriptions.language = :language and - descriptions in elements( t.descriptions) and + descriptions in elements( t.descriptions) + or t.descriptions.size = 0 + ) and t.taskData.status in ('Created', 'Ready', 'Reserved', 'InProgress', 'Suspended') and @@ -293,7 +339,7 @@ -select +select new org.drools.task.query.TaskSummary( t.id, names.text, @@ -307,32 +353,38 @@ t.taskData.createdOn, t.taskData.activationTime, t.taskData.expirationTime) -from +from Task t left join t.taskData.createdBy, I18NText names, I18NText subjects, - I18NText descriptions, + I18NText descriptions, OrganizationalEntity recipients -where +where recipients.id = :userId and - recipients in elements ( t.peopleAssignments.recipients ) and - + recipients in elements ( t.peopleAssignments.recipients ) and + names.language = :language and names in elements( t.names) and - + + ( subjects.language = :language and - subjects in elements( t.subjects) and - + subjects in elements( t.subjects) + or t.subjects.size = 0 + ) and + + ( descriptions.language = :language and - descriptions in elements( t.descriptions) and - - t.taskData.expirationTime is null + descriptions in elements( t.descriptions) + or t.descriptions.size = 0 + ) and + + t.taskData.expirationTime is null -select +select new org.drools.task.query.TaskSummary( t.id, names.text, @@ -346,32 +398,38 @@ t.taskData.createdOn, t.taskData.activationTime, t.taskData.expirationTime) -from +from Task t left join t.taskData.createdBy, I18NText names, I18NText subjects, - I18NText descriptions, + I18NText descriptions, OrganizationalEntity taskInitiator -where +where taskInitiator.id = :userId and - taskInitiator = t.peopleAssignments.taskInitiator and - + taskInitiator = t.peopleAssignments.taskInitiator and + names.language = :language and names in elements( t.names) and - + + ( subjects.language = :language and - subjects in elements( t.subjects) and - + subjects in elements( t.subjects) + or t.subjects.size = 0 + ) and + + ( descriptions.language = :language and - descriptions in elements( t.descriptions) and - - t.taskData.expirationTime is null + descriptions in elements( t.descriptions) + or t.descriptions.size = 0 + ) and + + t.taskData.expirationTime is null -select +select new org.drools.task.query.TaskSummary( t.id, names.text, @@ -385,32 +443,38 @@ t.taskData.createdOn, t.taskData.activationTime, t.taskData.expirationTime) -from +from Task t left join t.taskData.createdBy, I18NText names, I18NText subjects, - I18NText descriptions, + I18NText descriptions, OrganizationalEntity taskStakeholder -where +where taskStakeholder.id = :userId and - taskStakeholder in elements ( t.peopleAssignments.taskStakeholders ) and - + taskStakeholder in elements ( t.peopleAssignments.taskStakeholders ) and + names.language = :language and names in elements( t.names) and - + + ( subjects.language = :language and - subjects in elements( t.subjects) and - + subjects in elements( t.subjects) + or t.subjects.size = 0 + ) and + + ( descriptions.language = :language and - descriptions in elements( t.descriptions) and - - t.taskData.expirationTime is null + descriptions in elements( t.descriptions) + or t.descriptions.size = 0 + ) and + + t.taskData.expirationTime is null -select +select new org.drools.task.query.TaskSummary( t.id, names.text, @@ -424,39 +488,48 @@ t.taskData.createdOn, t.taskData.activationTime, t.taskData.expirationTime) -from +from Task t left join t.taskData.createdBy, I18NText names, I18NText subjects, - I18NText descriptions -where + I18NText descriptions +where t.taskData.actualOwner.id = :userId and names in elements( t.names) and names.language = :language and - subjects in elements( t.subjects) and + + ( subjects.language = :language and - descriptions in elements( t.descriptions) and - descriptions.language = :language and - t.taskData.expirationTime is null + subjects in elements( t.subjects) + or t.subjects.size = 0 + ) and + + ( + descriptions.language = :language and + descriptions in elements( t.descriptions) + or t.descriptions.size = 0 + ) and + + t.taskData.expirationTime is null - + -select +select new org.drools.task.query.DeadlineSummary( t.id, d.id, d.date) -from +from Task t, Deadline d -where - (d in elements( t.deadlines.startDeadlines ) or d in elements( t.deadlines.endDeadlines ) ) and +where + (d in elements( t.deadlines.startDeadlines ) or d in elements( t.deadlines.endDeadlines ) ) and d.escalated = false order by - d.date + d.date - +