home *** CD-ROM | disk | FTP | other *** search
/ PC Extra 07 & 08 / pca1507.iso / intface / pca / special4 / software / eclipse.project / WEB-INF / classes / nl / pcactive / bean / IndividualBean.java < prev    next >
Encoding:
Java Source  |  2003-05-20  |  3.1 KB  |  134 lines

  1. package nl.pcactive.bean;
  2.  
  3. import java.sql.ResultSet;
  4. import java.sql.SQLException;
  5.  
  6. /**
  7.  * <p>Description: GEDCOM 2 DATABASE</p>
  8.  * <p>Copyright: Copyright (c) 2002</p>
  9.  * <p>Company: Pc-Active</p>
  10.  * @author Benny Lootens
  11.  * @version 2.0
  12.  */
  13. public class IndividualBean {
  14.  
  15.         private String id;
  16.         private String first;
  17.         private String middle;
  18.         private String last;
  19.         private String sex;
  20.         private IEventBean birth;
  21.         private IEventBean baptism;
  22.         private IEventBean death;
  23.         private IEventBean burried;
  24.         private String notes;
  25.  
  26.         public void clear()
  27.         {
  28.             id = first = middle = last = sex = notes = "";
  29.             birth.clear();
  30.             baptism.clear();
  31.             death.clear();
  32.             burried.clear();
  33.         }
  34.   public String getSex() {
  35.     return sex;
  36.   }
  37.   public String getNotes() {
  38.     return notes!=null ? notes : "";
  39.   }
  40.   public String getMiddle() {
  41.     return middle;
  42.   }
  43.   public String getLast() {
  44.     return last;
  45.   }
  46.   public String getId() {
  47.     return id!=null && id.length()>0 ? id : "0";
  48.   }
  49.   public String getFirst() {
  50.     return first;
  51.   }
  52.   public IEventBean getDeath() {
  53.     return death;
  54.   }
  55.   public IEventBean getBurried() {
  56.     return burried;
  57.   }
  58.   public IEventBean getBirth() {
  59.     return birth;
  60.   }
  61.   public IEventBean getBaptism() {
  62.     return baptism;
  63.   }
  64.   public void setBaptism(IEventBean baptism) {
  65.     this.baptism = baptism;
  66.   }
  67.   public void setBirth(IEventBean birth) {
  68.     this.birth = birth;
  69.   }
  70.   public void setBurried(IEventBean burried) {
  71.     this.burried = burried;
  72.   }
  73.   public void setDeath(IEventBean death) {
  74.     this.death = death;
  75.   }
  76.   public void setFirst(String first) {
  77.     this.first = first;
  78.   }
  79.   public void setId(String id) {
  80.     this.id = id;
  81.   }
  82.   public void setLast(String last) {
  83.     this.last = last;
  84.   }
  85.   public void setMiddle(String middle) {
  86.     this.middle = middle;
  87.   }
  88.   public void setNotes(String notes) {
  89.     this.notes = notes;
  90.   }
  91.   public void setSex(String sex) {
  92.     this.sex = sex;
  93.   }
  94.  
  95.   public IndividualBean()
  96.   {
  97.       birth = new IEventBean();
  98.       baptism = new IEventBean();
  99.       death = new IEventBean();
  100.       burried = new IEventBean();
  101.       clear();
  102.   }
  103.  
  104.   /** populate this bean with the database resultset */
  105.   public void populate(ResultSet rs) throws SQLException {
  106.     setId(""+rs.getInt("individual"));
  107.     setFirst(rs.getString("firstname"));
  108.     setMiddle(rs.getString("middlename"));
  109.     setLast(rs.getString("lastname"));
  110.     setSex(rs.getString("sex"));
  111.  
  112.     IEventBean birth = new IEventBean();
  113.     birth.setDate(rs.getString("birthdate"));
  114.     birth.setPlace(rs.getString("birthplace"));
  115.     setBirth(birth);
  116.  
  117.     IEventBean baptism = new IEventBean();
  118.     baptism.setDate(rs.getString("baptismdate"));
  119.     baptism.setPlace(rs.getString("baptismplace"));
  120.     setBaptism(baptism);
  121.  
  122.     IEventBean death = new IEventBean();
  123.     death.setDate(rs.getString("deathdate"));
  124.     death.setPlace(rs.getString("deathplace"));
  125.     setDeath(death);
  126.  
  127.     IEventBean burried = new IEventBean();
  128.     burried.setDate(rs.getString("burrieddate"));
  129.     burried.setPlace(rs.getString("burriedplace"));
  130.     setBurried(burried);
  131.  
  132.     setNotes(rs.getString("notes"));
  133.   }
  134. }