Mercurial > hg > LGServices
comparison src/main/java/de/mpiwg/gazetteer/db/DBContents.java @ 40:35ed4e650a53
bug fixed: full text search when section not found in section_index table. add paginator
author | Zoe Hong <zhong@mpiwg-berlin.mpg.de> |
---|---|
date | Mon, 07 Dec 2015 17:06:57 +0100 |
parents | 37840afb7b80 |
children | 7c2e1b14b77d |
comparison
equal
deleted
inserted
replaced
39:37840afb7b80 | 40:35ed4e650a53 |
---|---|
10 | 10 |
11 public class DBContents implements Comparable<DBContents>{ | 11 public class DBContents implements Comparable<DBContents>{ |
12 | 12 |
13 private Long id; | 13 private Long id; |
14 | 14 |
15 private String bookId; | 15 private String bookId = ""; |
16 private Integer page; | 16 private Integer page = 0; |
17 private String content; | 17 private String content = ""; |
18 | 18 |
19 private DBSection section; // section already contain DBBook | 19 private DBSection section = null; // section already contain DBBook |
20 private Integer inx = null; // local index for each row | 20 private Integer inx = null; // local index for each row |
21 | 21 |
22 private DBCoordinatesBook coordinatesBook = null; | 22 private DBCoordinatesBook coordinatesBook = null; |
23 | 23 |
24 private boolean isRemoved = false; | 24 private boolean isRemoved = false; |
29 this.id = rs.getLong("id"); | 29 this.id = rs.getLong("id"); |
30 this.bookId = rs.getString("books_id"); | 30 this.bookId = rs.getString("books_id"); |
31 this.page = rs.getInt("line"); | 31 this.page = rs.getInt("line"); |
32 this.content = rs.getString("content"); | 32 this.content = rs.getString("content"); |
33 | 33 |
34 // set this.section by bookId and page | |
35 this.section = DBService.getInstance().getSectionByBookIdAndPage(this.bookId, this.page); | |
36 | |
37 // set this.coordinatesBook by bookId | |
38 this.coordinatesBook = DBService.getInstance().getCoordinatesBook(bookId); | |
39 | |
40 } | 34 } |
41 | 35 |
42 | 36 |
43 public Long getId() { | 37 public Long getId() { |
44 return id; | 38 return id; |
118 public void setRemoved(boolean isRemoved) { | 112 public void setRemoved(boolean isRemoved) { |
119 this.isRemoved = isRemoved; | 113 this.isRemoved = isRemoved; |
120 } | 114 } |
121 | 115 |
122 | 116 |
117 | |
123 @Override | 118 @Override |
124 public int compareTo(DBContents o) { | 119 public int compareTo(DBContents o) { |
125 return this.getInx().compareTo(o.getInx()); | 120 return this.getId().compareTo(o.getId()); |
126 } | 121 } |
122 | |
127 } | 123 } |