コード例 #1
0
  /** Persist an entity given all attributes */
  public DClass persist(
      Object raceKey,
      java.lang.Long id,
      java.util.Date actualStart,
      java.lang.String name,
      java.util.Date scheduledStart,
      se.bassac.roster.domain.DTrack track) {

    DClass domain = null;
    // if primaryKey specified, use it
    if (null != id) {
      domain = findByPrimaryKey(raceKey, id);
    }

    // create new?
    if (null == domain) {
      domain = new DClass();
      // set parent
      domain.setRaceKey((java.lang.Object) raceKey);
      // generate Id?
      if (null != id) {
        domain.setId(id);
      }
      // fields
      domain.setActualStart(actualStart);
      domain.setName(name);
      domain.setScheduledStart(scheduledStart);
      // one-to-ones
      // many-to-ones
      domain.setTrack(track);

      persist(domain);
    }
    return domain;
  }
コード例 #2
0
 @Override
 protected void setDomainProperty(final DClass domain, final String name, final Object value) {
   // simple key?
   if (COLUMN_NAME_ID.equals(name)) {
     domain.setId((java.lang.Long) value);
   }
   // parent key?
   else if (COLUMN_NAME_RACEKEY.equals(name)) {
     domain.setRaceKey((java.lang.Object) value);
   }
   // fields
   else if (COLUMN_NAME_ACTUALSTART.equals(name)) {
     domain.setActualStart((java.util.Date) value);
   } else if (COLUMN_NAME_CREATEDBY.equals(name)) {
     domain.setCreatedBy((java.lang.String) value);
   } else if (COLUMN_NAME_CREATEDDATE.equals(name)) {
     domain.setCreatedDate((java.util.Date) value);
   } else if (COLUMN_NAME_NAME.equals(name)) {
     domain.setName((java.lang.String) value);
   } else if (COLUMN_NAME_SCHEDULEDSTART.equals(name)) {
     domain.setScheduledStart((java.util.Date) value);
   } else if (COLUMN_NAME_UPDATEDBY.equals(name)) {
     domain.setUpdatedBy((java.lang.String) value);
   } else if (COLUMN_NAME_UPDATEDDATE.equals(name)) {
     domain.setUpdatedDate((java.util.Date) value);
   }
   // one-to-ones
   // many-to-ones
   else if (COLUMN_NAME_TRACK.equals(name)) {
     DTrack foreign = null;
     if (null != value) {
       foreign = trackDao.createDomain(value);
     }
     domain.setTrack(foreign);
   }
   // many-to-manys
   else {
     super.setDomainProperty(domain, name, value);
   }
 }
コード例 #3
0
  @Override
  protected Object getDomainProperty(DClass domain, String name) {
    Object value;
    // simple key?
    if (COLUMN_NAME_ID.equals(name)) {
      value = domain.getId();
    }
    // parent key?
    else if (COLUMN_NAME_RACEKEY.equals(name)) {
      value = domain.getRaceKey();
    }
    // fields
    else if (COLUMN_NAME_ACTUALSTART.equals(name)) {
      value = domain.getActualStart();
    } else if (COLUMN_NAME_CREATEDBY.equals(name)) {
      value = domain.getCreatedBy();
    } else if (COLUMN_NAME_CREATEDDATE.equals(name)) {
      value = domain.getCreatedDate();
    } else if (COLUMN_NAME_NAME.equals(name)) {
      value = domain.getName();
    } else if (COLUMN_NAME_SCHEDULEDSTART.equals(name)) {
      value = domain.getScheduledStart();
    } else if (COLUMN_NAME_UPDATEDBY.equals(name)) {
      value = domain.getUpdatedBy();
    } else if (COLUMN_NAME_UPDATEDDATE.equals(name)) {
      value = domain.getUpdatedDate();
    }
    // one-to-ones
    // many-to-ones
    else if (COLUMN_NAME_TRACK.equals(name)) {
      value = domain.getTrack();
    }
    // many-to-manys
    else {
      value = super.getDomainProperty(domain, name);
    }

    return value;
  }
コード例 #4
0
 public void _setUpdatedDate(DClass domain, Date date) {
   domain.setUpdatedDate(date);
 }
コード例 #5
0
 public Date getUpdatedDate(DClass domain) {
   if (null == domain) {
     return null;
   }
   return domain.getUpdatedDate();
 }
コード例 #6
0
 public void _setUpdatedBy(DClass domain, String updator) {
   domain.setUpdatedBy(updator);
 }
コード例 #7
0
 public String getUpdatedBy(DClass domain) {
   if (null == domain) {
     return null;
   }
   return domain.getUpdatedBy();
 }
コード例 #8
0
 public void _setCreatedBy(DClass domain, String creator) {
   domain.setCreatedBy(creator);
 }
コード例 #9
0
 /** @return the simple key for specified DClass domain object */
 public void setSimpleKey(DClass domain, Long id) {
   domain.setId(id);
 }
コード例 #10
0
 /** @return the simple key for specified DClass domain object */
 public Long getSimpleKey(DClass domain) {
   if (null == domain) {
     return null;
   }
   return domain.getId();
 }
コード例 #11
0
 public void setParentKey(DClass domain, Object raceKey) {
   domain.setRaceKey((Serializable) raceKey);
 }
コード例 #12
0
 public Object getParentKey(DClass domain) {
   return domain.getRaceKey();
 }