Mercurial > hg > LGServices
diff 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 |
line wrap: on
line diff
--- a/src/main/java/de/mpiwg/gazetteer/db/DBContents.java Fri Dec 04 14:28:44 2015 +0100 +++ b/src/main/java/de/mpiwg/gazetteer/db/DBContents.java Mon Dec 07 17:06:57 2015 +0100 @@ -12,11 +12,11 @@ private Long id; - private String bookId; - private Integer page; - private String content; + private String bookId = ""; + private Integer page = 0; + private String content = ""; - private DBSection section; // section already contain DBBook + private DBSection section = null; // section already contain DBBook private Integer inx = null; // local index for each row private DBCoordinatesBook coordinatesBook = null; @@ -31,12 +31,6 @@ this.page = rs.getInt("line"); this.content = rs.getString("content"); - // set this.section by bookId and page - this.section = DBService.getInstance().getSectionByBookIdAndPage(this.bookId, this.page); - - // set this.coordinatesBook by bookId - this.coordinatesBook = DBService.getInstance().getCoordinatesBook(bookId); - } @@ -120,8 +114,10 @@ } + @Override public int compareTo(DBContents o) { - return this.getInx().compareTo(o.getInx()); + return this.getId().compareTo(o.getId()); } + }