Mercurial > hg > LGServices
view src/main/java/de/mpiwg/gazetteer/db/DBSection.java @ 43:9dbbbfd474f4
new: 1.existing topic in search result. 2.difference-set of book for topic
author | Zoe Hong <zhong@mpiwg-berlin.mpg.de> |
---|---|
date | Wed, 23 Dec 2015 16:03:32 +0100 |
parents | 35ed4e650a53 |
children |
line wrap: on
line source
package de.mpiwg.gazetteer.db; import java.sql.ResultSet; import java.sql.SQLException; import java.util.List; import de.mpiwg.gazetteer.bo.LGBranch; import de.mpiwg.gazetteer.bo.LGTopic; import de.mpiwg.gazetteer.bo.LGTopicSectionRelation; public class DBSection implements Comparable<DBSection>{ private Long id; private String name; private String text; private String bookId; private DBBook book; private Integer start_page; private Integer end_page; private List<LGBranch> branches; private List<LGTopicSectionRelation> topicSectionRelation; /* public DBSection(Long id){ this.id = id; } public DBSection(Long id, String name, String bookId){ this.id = id; this.name = name; this.bookId = bookId; }*/ public DBSection() { this.name = "-"; this.id = null; this.bookId = null; this.start_page = null; this.end_page = null; } public DBSection(ResultSet rs) throws SQLException{ this.name = rs.getString("name"); this.id = rs.getLong("id"); this.bookId = rs.getString("books_id"); this.start_page = rs.getInt("start_page"); this.end_page = rs.getInt("end_page"); } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getBookId() { return bookId; } public void setBookId(String bookId) { this.bookId = bookId; } public String getText() { return text; } public void setText(String text) { this.text = text; } public DBBook getBook() { return book; } public void setBook(DBBook book) { this.book = book; } public List<LGBranch> getBranches() { return branches; } public void setBranches(List<LGBranch> branches) { this.branches = branches; } public List<LGTopicSectionRelation> getTopicSectionRelation() { return topicSectionRelation; } public void setTopicSectionRelation( List<LGTopicSectionRelation> topicSectionRelation) { this.topicSectionRelation = topicSectionRelation; } public Integer getStart_page() { return start_page; } public void setStart_page(Integer start_page) { this.start_page = start_page; } public Integer getEnd_page() { return end_page; } public void setEnd_page(Integer end_page) { this.end_page = end_page; } public String getPages(){ return this.start_page + " - " + this.end_page; } @Override public int compareTo(DBSection o) { return this.getName().compareTo(o.getName()); } }