1414@ Repository
1515public interface TaskRepository extends JpaRepository <Task , Long > {
1616
17+ //TODO: #244 change List<Task> to Page<Task>
18+ @ Deprecated
1719 List <Task > findByProject (Project thisProject );
18-
1920 Page <Task > findByProject (Project thisProject , Pageable pageable );
20-
2121 Page <Task > findByFocusAndContext (boolean focus , Context context , Pageable request );
22-
2322 Page <Task > findByProjectIsNullAndContext (Context context , Pageable request );
2423
24+ //TODO: #244 change List<Task> to Page<Task>
25+ @ Deprecated
2526 List <Task > findByContext (Context context );
27+ Page <Task > findByContext (Context context , Pageable pageable );
2628
27- Task findTopByTaskStateAndContextOrderByOrderIdTaskStateDesc (TaskState inbox , Context context );
28-
29- Task findTopByProjectAndContextOrderByOrderIdProjectIsNullDesc (Context context );
30-
29+ Task findTopByTaskStateAndContextOrderByOrderIdTaskStateDesc (TaskState taskState , Context context );
30+ Task findTopByProjectIsNullAndContextOrderByOrderIdProjectDesc (Context context );
3131 Task findTopByProjectAndContextOrderByOrderIdProjectDesc (Project project , Context context );
3232
33- Page <Task > findByTaskStateAndContext ( TaskState taskState , Context context , Pageable request );
34-
33+ //TODO: #244 change List <Task> to Page<Task>>
34+ @ Deprecated
3535 List <Task > findByTaskStateAndContext (TaskState taskState , Context context );
36+ Page <Task > findByTaskStateAndContext (TaskState taskState , Context context , Pageable request );
3637
37- List <Task > findByTaskStateAndContextOrderByOrderIdTaskStateAsc (TaskState taskState , Context context );
38+ //TODO: #244 change List<Task> to Page<Task>
39+ @ Deprecated
40+ List <Task > findByTaskStateAndContextOrderByOrderIdTaskStateAsc (
41+ TaskState taskState , Context context
42+ );
43+ Page <Task > findByTaskStateAndContextOrderByOrderIdTaskStateAsc (
44+ TaskState taskState , Context context , Pageable request
45+ );
3846
47+ //TODO: #244 change List<Task> to Page<Task>
48+ //TODO: move the JQL Query-String to Entity as Prepared Statement
49+ @ Deprecated
3950 @ Query ("select t from Task t"
4051 + " where t.orderIdTaskState > :lowerOrderIdTaskState and t.orderIdTaskState < :higherOrderIdTaskState"
4152 + " and t.taskState = :taskState and t.context = :context" )
@@ -45,17 +56,43 @@ List<Task> getTasksByOrderIdTaskStateBetweenLowerTaskAndHigherTask(
4556 @ Param ("taskState" ) TaskState taskState ,
4657 @ Param ("context" ) Context context
4758 );
59+ //TODO: move the JQL Query-String to Entity as Prepared Statement
60+ @ Query ("select t from Task t"
61+ + " where t.orderIdTaskState > :lowerOrderIdTaskState and t.orderIdTaskState < :higherOrderIdTaskState"
62+ + " and t.taskState = :taskState and t.context = :context" )
63+ Page <Task > getTasksByOrderIdTaskStateBetweenLowerTaskAndHigherTask (
64+ @ Param ("lowerOrderIdTaskState" ) long lowerOrderIdTaskState ,
65+ @ Param ("higherOrderIdTaskState" ) long higherOrderIdTaskState ,
66+ @ Param ("taskState" ) TaskState taskState ,
67+ @ Param ("context" ) Context context ,
68+ Pageable request
69+ );
4870
71+ //TODO: #244 change List<Task> to Page<Task>
72+ //TODO: move the JQL Query-String to Entity as Prepared Statement
73+ @ Deprecated
4974 @ Query ("select t from Task t"
5075 + " where t.orderIdProject > :lowerOrderIdProject and t.orderIdProject < :higherOrderIdProject"
51- + " and t.project = :project and t.context = :context " )
76+ + " and t.project = :project" )
5277 List <Task > getTasksByOrderIdProjectBetweenLowerTaskAndHigherTask (
78+ @ Param ("lowerOrderIdProject" ) long lowerOrderIdProject ,
79+ @ Param ("higherOrderIdProject" ) long higherOrderIdProject ,
80+ @ Param ("project" ) Project project
81+ );
82+ //TODO: move the JQL Query-String to Entity as Prepared Statement
83+ @ Query ("select t from Task t"
84+ + " where t.orderIdProject > :lowerOrderIdProject and t.orderIdProject < :higherOrderIdProject"
85+ + " and t.project = :project" )
86+ Page <Task > getTasksByOrderIdProjectBetweenLowerTaskAndHigherTask (
5387 @ Param ("lowerOrderIdProject" ) long lowerOrderIdProject ,
5488 @ Param ("higherOrderIdProject" ) long higherOrderIdProject ,
5589 @ Param ("project" ) Project project ,
56- @ Param ( "context" ) Context context
90+ Pageable request
5791 );
5892
93+ //TODO: move from List<Task> to Page<Task>
94+ //TODO: move the JQL Query-String to Entity as Prepared Statement
95+ @ Deprecated
5996 @ Query ("select t from Task t"
6097 + " where t.orderIdProject > :lowerOrderIdProject and t.orderIdProject < :higherOrderIdProject"
6198 + " and t.project is null and t.context = :context " )
@@ -64,5 +101,15 @@ List<Task> getTasksByOrderIdProjectRootBetweenLowerTaskAndHigherTask(
64101 @ Param ("higherOrderIdProject" ) long higherOrderIdProject ,
65102 @ Param ("context" ) Context context
66103 );
104+ //TODO: move the JQL Query-String to Entity as Prepared Statement
105+ @ Query ("select t from Task t"
106+ + " where t.orderIdProject > :lowerOrderIdProject and t.orderIdProject < :higherOrderIdProject"
107+ + " and t.project is null and t.context = :context " )
108+ Page <Task > getTasksByOrderIdProjectRootBetweenLowerTaskAndHigherTask (
109+ @ Param ("lowerOrderIdProject" ) long lowerOrderIdProject ,
110+ @ Param ("higherOrderIdProject" ) long higherOrderIdProject ,
111+ @ Param ("context" ) Context context ,
112+ Pageable request
113+ );
67114
68115}
0 commit comments