Mercurial > hg > LGServices
comparison src/main/java/de/mpiwg/gazetteer/bo/LGTopic.java @ 48:13555aff1f88
new: multiple full text searching. topics and tasks improvement.
author | Zoe Hong <zhong@mpiwg-berlin.mpg.de> |
---|---|
date | Thu, 21 Jan 2016 11:56:30 +0100 |
parents | 9dbbbfd474f4 |
children | 95bf4ac726e6 |
comparison
equal
deleted
inserted
replaced
47:ef113c53629b | 48:13555aff1f88 |
---|---|
55 | 55 |
56 | 56 |
57 @Transient | 57 @Transient |
58 private boolean transientDataLoaded = false; | 58 private boolean transientDataLoaded = false; |
59 | 59 |
60 @Transient | |
61 private Integer numOfSections = 0; | |
60 | 62 |
61 | 63 |
62 public boolean isEmpty() { | 64 public boolean isEmpty() { |
63 if (nameEn.equals("") || nameCh.equals("") || namePinyin.equals("") ) { | 65 if (nameEn.equals("") || nameCh.equals("") || namePinyin.equals("") ) { |
64 return true; | 66 return true; |
215 public void setKeywords(String keywords) { | 217 public void setKeywords(String keywords) { |
216 this.keywords = keywords; | 218 this.keywords = keywords; |
217 } | 219 } |
218 | 220 |
219 | 221 |
220 | |
221 | |
222 public void setContributorsList(List<Long> contributorsList) { | 222 public void setContributorsList(List<Long> contributorsList) { |
223 this.contributorsList = contributorsList; | 223 this.contributorsList = contributorsList; |
224 } | 224 } |
225 | 225 |
226 | 226 |
227 public void setTransientDataLoaded(boolean transientDataLoaded) { | 227 public void setTransientDataLoaded(boolean transientDataLoaded) { |
228 this.transientDataLoaded = transientDataLoaded; | 228 this.transientDataLoaded = transientDataLoaded; |
229 } | 229 } |
230 | 230 |
231 | |
232 | |
233 public Integer getNumOfSections() { | |
234 if (numOfSections == 0){ | |
235 // TODO get number of sections in this topic from db table TopicSectionRelation with topicId=this.topicId | |
236 Long topicId = this.getId(); | |
237 | |
238 this.setNumOfSections(DataProvider.getInstance().getNumberOfSectionInTopic(topicId)); | |
239 | |
240 } | |
241 | |
242 return numOfSections; | |
243 } | |
244 | |
245 public void setNumOfSections(Integer numOfSections) { | |
246 this.numOfSections = numOfSections; | |
247 } | |
248 | |
249 | |
250 | |
251 | |
231 public DuplexKey<Long, Long> getKey(){ | 252 public DuplexKey<Long, Long> getKey(){ |
232 return new DuplexKey<Long, Long>(this.userId, this.id); | 253 return new DuplexKey<Long, Long>(this.userId, this.id); |
233 } | 254 } |
234 | 255 |
235 public String info() { | 256 public String info() { |
236 return nameEn + "(" + nameCh + ", " + namePinyin + ")"; | 257 return nameEn + "(" + nameCh + ", " + namePinyin + ")"; |
237 } | 258 } |
238 | 259 |
260 | |
261 | |
262 | |
239 @Override | 263 @Override |
240 public String toString(){ | 264 public String toString(){ |
241 return "LGTopic[nameEn=" + nameEn + ", nameCh=" + nameCh + ", namePinyin=" + namePinyin + "]"; | 265 return "LGTopic[nameEn=" + nameEn + ", nameCh=" + nameCh + ", namePinyin=" + namePinyin + "]"; |
242 } | 266 } |
243 | 267 |