home *** CD-ROM | disk | FTP | other *** search
Java Source | 2003-05-20 | 3.1 KB | 134 lines |
- package nl.pcactive.bean;
-
- import java.sql.ResultSet;
- import java.sql.SQLException;
-
- /**
- * <p>Description: GEDCOM 2 DATABASE</p>
- * <p>Copyright: Copyright (c) 2002</p>
- * <p>Company: Pc-Active</p>
- * @author Benny Lootens
- * @version 2.0
- */
- public class IndividualBean {
-
- private String id;
- private String first;
- private String middle;
- private String last;
- private String sex;
- private IEventBean birth;
- private IEventBean baptism;
- private IEventBean death;
- private IEventBean burried;
- private String notes;
-
- public void clear()
- {
- id = first = middle = last = sex = notes = "";
- birth.clear();
- baptism.clear();
- death.clear();
- burried.clear();
- }
- public String getSex() {
- return sex;
- }
- public String getNotes() {
- return notes!=null ? notes : "";
- }
- public String getMiddle() {
- return middle;
- }
- public String getLast() {
- return last;
- }
- public String getId() {
- return id!=null && id.length()>0 ? id : "0";
- }
- public String getFirst() {
- return first;
- }
- public IEventBean getDeath() {
- return death;
- }
- public IEventBean getBurried() {
- return burried;
- }
- public IEventBean getBirth() {
- return birth;
- }
- public IEventBean getBaptism() {
- return baptism;
- }
- public void setBaptism(IEventBean baptism) {
- this.baptism = baptism;
- }
- public void setBirth(IEventBean birth) {
- this.birth = birth;
- }
- public void setBurried(IEventBean burried) {
- this.burried = burried;
- }
- public void setDeath(IEventBean death) {
- this.death = death;
- }
- public void setFirst(String first) {
- this.first = first;
- }
- public void setId(String id) {
- this.id = id;
- }
- public void setLast(String last) {
- this.last = last;
- }
- public void setMiddle(String middle) {
- this.middle = middle;
- }
- public void setNotes(String notes) {
- this.notes = notes;
- }
- public void setSex(String sex) {
- this.sex = sex;
- }
-
- public IndividualBean()
- {
- birth = new IEventBean();
- baptism = new IEventBean();
- death = new IEventBean();
- burried = new IEventBean();
- clear();
- }
-
- /** populate this bean with the database resultset */
- public void populate(ResultSet rs) throws SQLException {
- setId(""+rs.getInt("individual"));
- setFirst(rs.getString("firstname"));
- setMiddle(rs.getString("middlename"));
- setLast(rs.getString("lastname"));
- setSex(rs.getString("sex"));
-
- IEventBean birth = new IEventBean();
- birth.setDate(rs.getString("birthdate"));
- birth.setPlace(rs.getString("birthplace"));
- setBirth(birth);
-
- IEventBean baptism = new IEventBean();
- baptism.setDate(rs.getString("baptismdate"));
- baptism.setPlace(rs.getString("baptismplace"));
- setBaptism(baptism);
-
- IEventBean death = new IEventBean();
- death.setDate(rs.getString("deathdate"));
- death.setPlace(rs.getString("deathplace"));
- setDeath(death);
-
- IEventBean burried = new IEventBean();
- burried.setDate(rs.getString("burrieddate"));
- burried.setPlace(rs.getString("burriedplace"));
- setBurried(burried);
-
- setNotes(rs.getString("notes"));
- }
- }