Mercurial > hg > LGServices
annotate 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 |
rev | line source |
---|---|
39 | 1 package de.mpiwg.gazetteer.db; |
2 | |
3 import java.sql.ResultSet; | |
4 import java.sql.SQLException; | |
5 import java.util.List; | |
6 | |
7 import de.mpiwg.gazetteer.utils.DBService; | |
8 | |
9 | |
10 | |
11 public class DBContents implements Comparable<DBContents>{ | |
12 | |
13 private Long id; | |
14 | |
40
35ed4e650a53
bug fixed: full text search when section not found in section_index table. add paginator
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
39
diff
changeset
|
15 private String bookId = ""; |
35ed4e650a53
bug fixed: full text search when section not found in section_index table. add paginator
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
39
diff
changeset
|
16 private Integer page = 0; |
35ed4e650a53
bug fixed: full text search when section not found in section_index table. add paginator
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
39
diff
changeset
|
17 private String content = ""; |
39 | 18 |
40
35ed4e650a53
bug fixed: full text search when section not found in section_index table. add paginator
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
39
diff
changeset
|
19 private DBSection section = null; // section already contain DBBook |
39 | 20 private Integer inx = null; // local index for each row |
21 | |
22 private DBCoordinatesBook coordinatesBook = null; | |
23 | |
24 private boolean isRemoved = false; | |
25 | |
26 | |
27 public DBContents(ResultSet rs) throws SQLException{ | |
28 | |
29 this.id = rs.getLong("id"); | |
30 this.bookId = rs.getString("books_id"); | |
31 this.page = rs.getInt("line"); | |
32 this.content = rs.getString("content"); | |
33 | |
34 } | |
35 | |
36 | |
37 public Long getId() { | |
38 return id; | |
39 } | |
40 public void setId(Long id) { | |
41 this.id = id; | |
42 } | |
43 | |
44 | |
45 public String getBookId() { | |
46 return bookId; | |
47 } | |
48 | |
49 public void setBookId(String bookId) { | |
50 this.bookId = bookId; | |
51 } | |
52 | |
53 | |
54 | |
55 public String getContent() { | |
56 return content; | |
57 } | |
58 | |
59 | |
60 public void setContent(String content) { | |
61 this.content = content; | |
62 } | |
63 | |
64 | |
65 public DBSection getSection() { | |
66 return section; | |
67 } | |
68 | |
69 | |
70 public void setSection(DBSection section) { | |
71 this.section = section; | |
72 } | |
73 | |
74 | |
75 | |
76 public Integer getPage() { | |
77 return page; | |
78 } | |
79 | |
80 | |
81 public void setPage(Integer page) { | |
82 this.page = page; | |
83 } | |
84 | |
85 | |
86 public Integer getInx() { | |
87 return inx; | |
88 } | |
89 | |
90 | |
91 public void setInx(Integer inx) { | |
92 this.inx = inx; | |
93 } | |
94 | |
95 | |
96 | |
97 public DBCoordinatesBook getCoordinatesBook() { | |
98 return coordinatesBook; | |
99 } | |
100 | |
101 | |
102 public void setCoordinatesBook(DBCoordinatesBook coordinatesBook) { | |
103 this.coordinatesBook = coordinatesBook; | |
104 } | |
105 | |
106 | |
107 public boolean isRemoved() { | |
108 return isRemoved; | |
109 } | |
110 | |
111 | |
112 public void setRemoved(boolean isRemoved) { | |
113 this.isRemoved = isRemoved; | |
114 } | |
115 | |
116 | |
40
35ed4e650a53
bug fixed: full text search when section not found in section_index table. add paginator
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
39
diff
changeset
|
117 |
39 | 118 @Override |
119 public int compareTo(DBContents o) { | |
40
35ed4e650a53
bug fixed: full text search when section not found in section_index table. add paginator
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
39
diff
changeset
|
120 return this.getId().compareTo(o.getId()); |
39 | 121 } |
40
35ed4e650a53
bug fixed: full text search when section not found in section_index table. add paginator
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
39
diff
changeset
|
122 |
39 | 123 } |