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;

/**
 * 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;
    private String name;
    private String memo;
    private Date date;

    @Transient
    private int state;

    /**
     *
     */
    public AppointmentModel() {
    }

    public int getState() {
        return this.state;
    }

    public void setState(int state) {
        this.state = state;
    }

    public String getPatientId() {
        return this.patientId;
    }
    
    public void setPatientId(String patientId) {
        this.patientId = patientId;
    }

    /**
     *
     * @return
     */
    public String getName() {
        return this.name;
    }
    
    public void setName(String name) {
        this.name = name;
    }

    public String getMemo() {
        return this.memo;
    }
    
    public void setMemo(String memo) {
        this.memo = memo;
    }

    /**
     *
     * @return
     */
    public Date getDate() {
        return this.date;
    }
    
    public void setDate(Date date) {
        this.date = date;
    }

    @Override
    public int compareTo(Object o) {
        Date s1 = this.date;
        Date s2 = ((AppointmentModel) o).getDate();
        return s1.compareTo(s2);
    }

    @Override
    public String toString() {
        return ModelUtils.getDateAsString(getDate());
    }

    /**
     *
     * @param result
     * @throws IOException
     */
    @Override
    public void serialize(Writer result) throws IOException {
        //TODO serialize
    }
}


