コード例 #1
0
  @Override
  public Calendar toEntityModel() {
    CalendarImpl calendarImpl = new CalendarImpl();

    if (uuid == null) {
      calendarImpl.setUuid(StringPool.BLANK);
    } else {
      calendarImpl.setUuid(uuid);
    }

    calendarImpl.setCalendarId(calendarId);
    calendarImpl.setGroupId(groupId);
    calendarImpl.setCompanyId(companyId);
    calendarImpl.setUserId(userId);

    if (userName == null) {
      calendarImpl.setUserName(StringPool.BLANK);
    } else {
      calendarImpl.setUserName(userName);
    }

    if (createDate == Long.MIN_VALUE) {
      calendarImpl.setCreateDate(null);
    } else {
      calendarImpl.setCreateDate(new Date(createDate));
    }

    if (modifiedDate == Long.MIN_VALUE) {
      calendarImpl.setModifiedDate(null);
    } else {
      calendarImpl.setModifiedDate(new Date(modifiedDate));
    }

    calendarImpl.setResourceBlockId(resourceBlockId);
    calendarImpl.setCalendarResourceId(calendarResourceId);

    if (name == null) {
      calendarImpl.setName(StringPool.BLANK);
    } else {
      calendarImpl.setName(name);
    }

    if (description == null) {
      calendarImpl.setDescription(StringPool.BLANK);
    } else {
      calendarImpl.setDescription(description);
    }

    calendarImpl.setColor(color);
    calendarImpl.setDefaultCalendar(defaultCalendar);
    calendarImpl.setEnableComments(enableComments);
    calendarImpl.setEnableRatings(enableRatings);

    calendarImpl.resetOriginalValues();

    return calendarImpl;
  }
コード例 #2
0
  @Override
  public Object clone() {
    CalendarImpl calendarImpl = new CalendarImpl();

    calendarImpl.setUuid(getUuid());
    calendarImpl.setCalendarId(getCalendarId());
    calendarImpl.setGroupId(getGroupId());
    calendarImpl.setCompanyId(getCompanyId());
    calendarImpl.setUserId(getUserId());
    calendarImpl.setUserName(getUserName());
    calendarImpl.setCreateDate(getCreateDate());
    calendarImpl.setModifiedDate(getModifiedDate());
    calendarImpl.setResourceBlockId(getResourceBlockId());
    calendarImpl.setCalendarResourceId(getCalendarResourceId());
    calendarImpl.setName(getName());
    calendarImpl.setDescription(getDescription());
    calendarImpl.setColor(getColor());
    calendarImpl.setDefaultCalendar(getDefaultCalendar());
    calendarImpl.setEnableComments(getEnableComments());
    calendarImpl.setEnableRatings(getEnableRatings());

    calendarImpl.resetOriginalValues();

    return calendarImpl;
  }