package com.aimluck.eip.cayenne.om.portlet;

import org.apache.cayenne.ObjectId;

import com.aimluck.eip.cayenne.om.portlet.auto._ImwTExtTimecardDetail;

public class ImwTExtTimecardDetail extends _ImwTExtTimecardDetail {

  public static final String DETAIL_ID_COLUMN = "DETAIL_ID";
  
  public static final String TIMECARD_ID_COLUMN = "TIMECARD_ID";
  
  public static final String JOB_ORDER_ID_COLUMN = "JOB_ORDER_ID";
  
  public static final String WORK_CLASS_COLUMN = "WORK_CLASS";
  
  public static final String WORKTIME_IN_COLUMN = "WORKTIME_IN";
  
  public static final String WORKTIME_OUT_COLUMN = "WORKTIME_OUT";
  
  public static final String WORK_PLACE_COLUMN = "WORK_PLACE";
  
  public static final String WORK_DETAIL_COLUMN = "WORK_DETAIL";
  
  public static final String DISABLED_COLUMN = "DISABLED";
  
  public static final String CREATE_DATE_COLUMN = "CREATE_DATE";
  
  public static final String CREATE_USER_ID_COLUMN = "CREATE_USER_ID";
  
  public static final String UPDATE_DATE_COLUMN = "UPDATE_DATE";
  
  public static final String UPDATE_USER_ID_COLUMN = "UPDATE_USER_ID";
  
  public static final String TIMECARD_ID_PROPERTY = "timecardId";
  
  public Integer getDetailId() {
    if (getObjectId() != null && !getObjectId().isTemporary()) {
      Object obj = getObjectId().getIdSnapshot().get(DETAIL_ID_PK_COLUMN);
      if (obj instanceof Long) {
        Long value = (Long) obj;
        return Integer.valueOf(value.intValue());
      } else {
        return (Integer) obj;
      }
    } else {
      return null;
    }
  }
  
  public void setDetailId(int id) {
    setObjectId(new ObjectId("ImwTExtTimecardDetail", DETAIL_ID_PK_COLUMN, id));
  }

  public void setSystemId(String id) {
    setObjectId(new ObjectId("ImwTExtTimecardDetail", DETAIL_ID_PK_COLUMN,
        Integer.valueOf(id)));
  }
  
  public void setTimecardId(Integer timecardId) {
    writeProperty("timecardId", timecardId);
  }

  public Integer getTimecardId() {
    return (Integer) readProperty("timecardId");
  }

  public Integer getGroupId() {
    if (getObjectId() != null && !getObjectId().isTemporary()) {
      Object obj = getObjectId().getIdSnapshot().get(DETAIL_ID_PK_COLUMN);
      if (obj instanceof Long) {
        Long value = (Long) obj;
        return Integer.valueOf(value.intValue());
      } else {
        return (Integer) obj;
      }
    } else {
      return null;
    }
  }

  public void setGroupId(String id) {
    setObjectId(new ObjectId("ImwTExtTimecardDetail", DETAIL_ID_PK_COLUMN,
        Integer.valueOf(id)));
  }
}
