diff src/main/java/de/mpiwg/gazetteer/db/DBSection.java @ 0:3e62083dbcbf

First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
author "jurzua <jurzua@mpiwg-berlin.mpg.de>"
date Thu, 23 Apr 2015 15:46:01 +0200
parents
children 35ed4e650a53
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/java/de/mpiwg/gazetteer/db/DBSection.java	Thu Apr 23 15:46:01 2015 +0200
@@ -0,0 +1,113 @@
+package de.mpiwg.gazetteer.db;
+
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.List;
+
+import de.mpiwg.gazetteer.bo.LGBranch;
+
+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;
+	
+	/*
+	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(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 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());
+	}
+}