Mercurial > hg > LGServices
comparison 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 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:3e62083dbcbf |
---|---|
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.bo.LGBranch; | |
8 | |
9 public class DBSection implements Comparable<DBSection>{ | |
10 | |
11 private Long id; | |
12 private String name; | |
13 private String text; | |
14 | |
15 private String bookId; | |
16 private DBBook book; | |
17 | |
18 private Integer start_page; | |
19 private Integer end_page; | |
20 | |
21 private List<LGBranch> branches; | |
22 | |
23 /* | |
24 public DBSection(Long id){ | |
25 this.id = id; | |
26 } | |
27 | |
28 | |
29 public DBSection(Long id, String name, String bookId){ | |
30 this.id = id; | |
31 this.name = name; | |
32 this.bookId = bookId; | |
33 }*/ | |
34 | |
35 public DBSection(ResultSet rs) throws SQLException{ | |
36 this.name = rs.getString("name"); | |
37 this.id = rs.getLong("id"); | |
38 this.bookId = rs.getString("books_id"); | |
39 this.start_page = rs.getInt("start_page"); | |
40 this.end_page = rs.getInt("end_page"); | |
41 } | |
42 | |
43 | |
44 public Long getId() { | |
45 return id; | |
46 } | |
47 public void setId(Long id) { | |
48 this.id = id; | |
49 } | |
50 public String getName() { | |
51 return name; | |
52 } | |
53 public void setName(String name) { | |
54 this.name = name; | |
55 } | |
56 | |
57 public String getBookId() { | |
58 return bookId; | |
59 } | |
60 | |
61 public void setBookId(String bookId) { | |
62 this.bookId = bookId; | |
63 } | |
64 | |
65 public String getText() { | |
66 return text; | |
67 } | |
68 | |
69 public void setText(String text) { | |
70 this.text = text; | |
71 } | |
72 | |
73 public DBBook getBook() { | |
74 return book; | |
75 } | |
76 | |
77 public void setBook(DBBook book) { | |
78 this.book = book; | |
79 } | |
80 | |
81 public List<LGBranch> getBranches() { | |
82 return branches; | |
83 } | |
84 | |
85 public void setBranches(List<LGBranch> branches) { | |
86 this.branches = branches; | |
87 } | |
88 | |
89 public Integer getStart_page() { | |
90 return start_page; | |
91 } | |
92 | |
93 public void setStart_page(Integer start_page) { | |
94 this.start_page = start_page; | |
95 } | |
96 | |
97 public Integer getEnd_page() { | |
98 return end_page; | |
99 } | |
100 | |
101 public void setEnd_page(Integer end_page) { | |
102 this.end_page = end_page; | |
103 } | |
104 | |
105 public String getPages(){ | |
106 return this.start_page + " - " + this.end_page; | |
107 } | |
108 | |
109 @Override | |
110 public int compareTo(DBSection o) { | |
111 return this.getName().compareTo(o.getName()); | |
112 } | |
113 } |