comparison src/main/java/de/mpiwg/gazetteer/db/DBBook.java @ 15:d81a5401b9af

new: sorting in books page
author Zoe Hong <zhong@mpiwg-berlin.mpg.de>
date Mon, 01 Jun 2015 14:35:35 +0200
parents 3387d855a194
children 9c4937b290c6
comparison
equal deleted inserted replaced
14:3387d855a194 15:d81a5401b9af
1 package de.mpiwg.gazetteer.db; 1 package de.mpiwg.gazetteer.db;
2 2
3 import java.sql.ResultSet; 3 import java.sql.ResultSet;
4 import java.sql.SQLException; 4 import java.sql.SQLException;
5 5
6 import com.sun.istack.internal.logging.Logger; 6 public class DBBook implements Comparable<DBBook>{
7
8 public class DBBook {
9 7
10 private String id; 8 private String id;
11 private String name; 9 private String name;
12 private Integer line; 10 private Integer line;
13 private String period; 11 private String period;
23 private String in_jibengujiku; 21 private String in_jibengujiku;
24 22
25 private Integer start_year; 23 private Integer start_year;
26 private Integer end_year; 24 private Integer end_year;
27 private String comments; 25 private String comments;
28 private int toc_correction; 26 private Integer toc_correction;
29 27
30 28
31 29
32 private DBSectionVersion currentSectionVersion; 30 private DBSectionVersion currentSectionVersion;
33 31
51 this.end_year = rs.getInt("end_year"); 49 this.end_year = rs.getInt("end_year");
52 this.comments = rs.getString("comments"); 50 this.comments = rs.getString("comments");
53 this.toc_correction = rs.getInt("toc_correction"); 51 this.toc_correction = rs.getInt("toc_correction");
54 52
55 } 53 }
54
55 @Override
56 public int compareTo(DBBook o) {
57 return this.getName().compareTo(o.getName());
58 }
56 59
57 public Integer getToc_correction() { 60 public Integer getToc_correction() {
58 return toc_correction; 61 return toc_correction;
59 } 62 }
60 63