@@ -75,61 +75,6 @@ public class Task implements DomainObjectMinimal<Task> {
7575 @ Column (name ="time_finished" )
7676 private Date timeFinished = null ;
7777
78- @ NotNull
79- @ OneToMany (cascade = {DETACH , REFRESH , REMOVE }, fetch = EAGER ,orphanRemoval =true , mappedBy ="task" )
80- private List <TaskHistory > history = new ArrayList <>();
81-
82- @ NotNull
83- @ Embedded
84- @ AttributeOverrides ({
85- @ AttributeOverride (name = "countUser" , column = @ Column (name = "start_count_user" ,nullable =false )),
86- @ AttributeOverride (name = "countTweets" , column = @ Column (name = "start_count_tweets" ,nullable =false )),
87- @ AttributeOverride (name = "countHashTags" , column = @ Column (name = "start_count_hashtags" ,nullable =false )),
88- @ AttributeOverride (name = "countMedia" , column = @ Column (name = "start_count_media" ,nullable =false )),
89- @ AttributeOverride (name = "countMention" , column = @ Column (name = "start_count_mention" ,nullable =false )),
90- @ AttributeOverride (name = "countTickerSymbol" , column = @ Column (name = "start_count_tickersymbol" ,nullable =false )),
91- @ AttributeOverride (name = "countUrl" , column = @ Column (name = "start_count_url" ,nullable =false )),
92- @ AttributeOverride (name = "countUrlCache" , column = @ Column (name = "start_count_urlcache" ,nullable =false )),
93- @ AttributeOverride (name = "countTask" , column = @ Column (name = "start_count_task" ,nullable =false )),
94- @ AttributeOverride (name = "countTaskHistory" , column = @ Column (name = "start_count_task_history" ,nullable =false )),
95- @ AttributeOverride (name = "tweet2hashtag" , column = @ Column (name = "start_count_tweet2hashtag" ,nullable =false )),
96- @ AttributeOverride (name = "tweet2media" , column = @ Column (name = "start_count_tweet2media" ,nullable =false )),
97- @ AttributeOverride (name = "tweet2mention" , column = @ Column (name = "start_count_tweet2mention" ,nullable =false )),
98- @ AttributeOverride (name = "tweet2tickersymbol" , column = @ Column (name = "start_count_tweet2tickersymbol" ,nullable =false )),
99- @ AttributeOverride (name = "tweet2url" , column = @ Column (name = "start_count_tweet2url" ,nullable =false )),
100- @ AttributeOverride (name = "userprofile2hashtag" , column = @ Column (name = "start_count_userprofile2hashtag" ,nullable =false )),
101- @ AttributeOverride (name = "userprofile2media" , column = @ Column (name = "start_count_userprofile2media" ,nullable =false )),
102- @ AttributeOverride (name = "userprofile2mention" , column = @ Column (name = "start_count_userprofile2mention" ,nullable =false )),
103- @ AttributeOverride (name = "userprofile2tickersymbol" , column = @ Column (name = "start_count_userprofile2tickersymbol" ,nullable =false )),
104- @ AttributeOverride (name = "userprofile2url" , column = @ Column (name = "start_count_userprofile2url" ,nullable =false ))
105- })
106- private CountedEntities countedEntitiesAtStart ;
107-
108- @ Embedded
109- @ AttributeOverrides ({
110- @ AttributeOverride (name = "countUser" , column = @ Column (name = "done_count_user" )),
111- @ AttributeOverride (name = "countTweets" , column = @ Column (name = "done_count_tweets" )),
112- @ AttributeOverride (name = "countHashTags" , column = @ Column (name = "done_count_hashtags" )),
113- @ AttributeOverride (name = "countMedia" , column = @ Column (name = "done_count_media" )),
114- @ AttributeOverride (name = "countMention" , column = @ Column (name = "done_count_mention" )),
115- @ AttributeOverride (name = "countTickerSymbol" , column = @ Column (name = "done_count_tickersymbol" )),
116- @ AttributeOverride (name = "countUrl" , column = @ Column (name = "done_count_url" )),
117- @ AttributeOverride (name = "countUrlCache" , column = @ Column (name = "done_count_urlcache" )),
118- @ AttributeOverride (name = "countTask" , column = @ Column (name = "done_count_task" )),
119- @ AttributeOverride (name = "countTaskHistory" , column = @ Column (name = "done_count_task_history" )),
120- @ AttributeOverride (name = "tweet2hashtag" , column = @ Column (name = "done_count_tweet2hashtag" )),
121- @ AttributeOverride (name = "tweet2media" , column = @ Column (name = "done_count_tweet2media" )),
122- @ AttributeOverride (name = "tweet2mention" , column = @ Column (name = "done_count_tweet2mention" )),
123- @ AttributeOverride (name = "tweet2tickersymbol" , column = @ Column (name = "done_count_tweet2tickersymbol" )),
124- @ AttributeOverride (name = "tweet2url" , column = @ Column (name = "done_count_tweet2url" )),
125- @ AttributeOverride (name = "userprofile2hashtag" , column = @ Column (name = "done_count_userprofile2hashtag" )),
126- @ AttributeOverride (name = "userprofile2media" , column = @ Column (name = "done_count_userprofile2media" )),
127- @ AttributeOverride (name = "userprofile2mention" , column = @ Column (name = "done_count_userprofile2mention" )),
128- @ AttributeOverride (name = "userprofile2tickersymbol" , column = @ Column (name = "done_count_userprofile2tickersymbol" )),
129- @ AttributeOverride (name = "userprofile2url" , column = @ Column (name = "done_count_userprofile2url" ))
130- })
131- private CountedEntities countedEntitiesAtFinish ;
132-
13378 private Task () {
13479 }
13580
@@ -138,16 +83,13 @@ public Task(String description,TaskType taskType) {
13883 this .description = description ;
13984 }
14085
141- public Task (String description , TaskType taskType , TaskStatus taskStatus , Date timeStarted , Date timeLastUpdate , Date timeFinished , List < TaskHistory > history , CountedEntities countedEntitiesAtStart , CountedEntities countedEntitiesAtFinish ) {
86+ public Task (String description , TaskType taskType , TaskStatus taskStatus , Date timeStarted , Date timeLastUpdate , Date timeFinished ) {
14287 this .description = description ;
14388 this .taskType = taskType ;
14489 this .taskStatus = taskStatus ;
14590 this .timeStarted = timeStarted ;
14691 this .timeLastUpdate = timeLastUpdate ;
14792 this .timeFinished = timeFinished ;
148- this .history = history ;
149- this .countedEntitiesAtStart = countedEntitiesAtStart ;
150- this .countedEntitiesAtFinish = countedEntitiesAtFinish ;
15193 }
15294
15395 @ Override
@@ -189,22 +131,6 @@ public void setTimeFinished(Date timeFinished) {
189131 this .timeFinished = timeFinished ;
190132 }
191133
192- public CountedEntities getCountedEntitiesAtStart () {
193- return countedEntitiesAtStart ;
194- }
195-
196- public void setCountedEntitiesAtStart (CountedEntities countedEntitiesAtStart ) {
197- this .countedEntitiesAtStart = countedEntitiesAtStart ;
198- }
199-
200- public CountedEntities getCountedEntitiesAtFinish () {
201- return countedEntitiesAtFinish ;
202- }
203-
204- public void setCountedEntitiesAtFinish (CountedEntities countedEntitiesAtFinish ) {
205- this .countedEntitiesAtFinish = countedEntitiesAtFinish ;
206- }
207-
208134 public TaskStatus getTaskStatus () {
209135 return taskStatus ;
210136 }
@@ -221,18 +147,6 @@ public void setDescription(String description) {
221147 this .description = description ;
222148 }
223149
224- public List <TaskHistory > getHistory () {
225- return history ;
226- }
227-
228- public void setHistory (List <TaskHistory > history ) {
229- this .history = history ;
230- }
231-
232- public void addHistory (TaskHistory history ) {
233- this .history .add (history );
234- }
235-
236150 public Date getTimeLastUpdate () {
237151 return timeLastUpdate ;
238152 }
@@ -248,23 +162,13 @@ public void setTimeLastUpdate() {
248162
249163 @ Override
250164 public String toString () {
251- String countedEntitiesAtFinishStr = "null" ;
252- if (countedEntitiesAtFinish != null ){
253- countedEntitiesAtFinishStr = countedEntitiesAtFinish .toString ();
254- }
255- String countedEntitiesAtStartStr = "null" ;
256- if (countedEntitiesAtStart != null ){
257- countedEntitiesAtStartStr = countedEntitiesAtStart .toString ();
258- }
259165 return "Task{" +
260166 "id=" + id +
261167 ", taskType=" + taskType +
262168 ", taskStatus=" +taskStatus +
263169 ", timeStarted=" + timeStarted +
264170 ", timeLastUpdate=" + timeLastUpdate +
265171 ", timeFinished=" + timeFinished +
266- ", countedEntitiesAtStart=" + countedEntitiesAtStartStr +
267- ", countedEntitiesAtFinish=" + countedEntitiesAtFinishStr +
268172 '}' ;
269173 }
270174
0 commit comments