publicフィールド

Teeda 1.0.11によりpublicフィールドが繰り返し項目にも対応したのが嬉しいです。


例えば、従業員の一覧を表示する場合はこんなにもスッキリしたソースコードになります。

従業員のプロパティ:

  • 従業員ID(empId)
  • 従業員名(empName)
  • 入社日(hireDate)
  • 部署名(deptName)


publicフィールド使用前

  private int empIndex;

  private EmpDto[] empItems;
	
  private Integer empId;
	
  private String empName;
	
  private Date hireDate;

  private String deptName;

  public int getEmpIndex() {
    return empIndex;
  }

  public void setEmpIndex(int empIndex) {
    this.empIndex = empIndex;
  }

  public EmpDto[] getEmpItems() {
    return empItems;
  }

  public void setEmpItems(EmpDto[] empItems) {
    this.empItems = empItems;
  }

  public Integer getEmpId() {
    return empId;
  }

  public void setEmpId(Integer empId) {
    this.empId = empId;
  }	

  public String getEmpName() {
    return empName;
  }

  public void setEmpName(String empName) {
    this.empName = empName;
  }
	
  public Date getHireDate() {
    return hireDate;
  }

  public void setHireDate(Date hireDate) {
    this.hireDate = hireDate;
  }
	
  public String getDeptName() {
    return deptName;
  }

  public void setDeptName(String deptName) {
    this.deptName = deptName;
  }


publicフィールド使用後

  public int empIndex;

  public EmpDto[] empItems;
	
  public Integer empId;
	
  public String empName;
	
  public Date hireDate;

  public String deptName;

ps. アクセッサメソッドは必要になった時点で書けばよい。