package open.dolphin.infomodel;
// Generated 2010/06/30 10:57:59 by Hibernate Tools 3.2.1.GA

import java.io.IOException;
import java.io.Writer;
import java.util.Date;
import javax.persistence.Transient;

/**
 * 予約 MEMO:マッピング d_appo
 * データベースレコードマッピングクラス
 * AppointmentModel generated by hbm2java
 */
public class AppointmentModel extends KarteEntryBean {

    /**
     *
     */
    public static final int TT_NONE = 0;
    /**
     *
     */
    public static final int TT_NEW = 1;
    /**
     *
     */
    public static final int TT_HAS = 2;
    /**
     *
     */
    public static final int TT_REPLACE = 3;
    private String patientId;//患者ID MEMO:Refrection
    private String name;//MEMO:Refrection
    private String memo;//MEMO:Refrection
    private Date date;//MEMO:Refrection
    @Transient
    private int state;

    /**
     *　コンストラクタ
     */
    public AppointmentModel() {
    }

    /**
     * stateのGetter
     * @return state TT_NONE = 0 TT_NEW = 1 TT_HAS = 2 TT_REPLACE = 3
     */
    public int getState() {
        return this.state;
    }

    /**
     * stateのSetter
     * @param state TT_NONE = 0 TT_NEW = 1 TT_HAS = 2 TT_REPLACE = 3
     */
    public void setState(int state) {
        this.state = state;
    }

    /**
     * 患者IDのGetter
     * MEMO:Refrection
     * @return 患者ID
     */
    public String getPatientId() {
        return this.patientId;
    }

    /**
     * 患者IDのSetter
     * MEMO:Refrection
     * @param patientId 患者ID
     */
    public void setPatientId(String patientId) {
        this.patientId = patientId;
    }

    /**
     * nameのGetter
     * MEMO:Refrection
     * @return name
     */
    public String getName() {
        return this.name;
    }

    /**
     * nameのSetter
     * MEMO:Refrection
     * @param name
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * memoのGetter
     * MEMO:Refrection
     * @return memo
     */
    public String getMemo() {
        return this.memo;
    }

    /**
     * memoのSetter
     * MEMO:Refrection
     * @param memo
     */
    public void setMemo(String memo) {
        this.memo = memo;
    }

    /**
     * dateのGetter
     * MEMO:Refrection
     * @return date
     */
    public Date getDate() {
        return this.date;
    }

    /**
     * dateのSetter
     * MEMO:Refrection
     * @param date
     */
    public void setDate(Date date) {
        this.date = date;
    }

    /**
     *　日付比較
     * @param o 比較対象
     * @return -1 0 1
     */
    @Override
    public int compareTo(Object o) {
        Date s1 = this.date;
        Date s2 = ((AppointmentModel) o).getDate();
        return s1.compareTo(s2);
    }

    /**
     *　日付を文字列に
     * @return　日付の文字列
     */
    @Override
    public String toString() {
        return ModelUtils.getDateAsString(getDate());
    }

    /**
     *　オーバーライド（何もしない）
     * @param result
     * @throws IOException
     */
    @Override
    public void serialize(Writer result) throws IOException {
        //TODO serialize
    }
}
