/** 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;
  }
 @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);
   }
 }
  @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;
  }
 public void _setUpdatedDate(DClass domain, Date date) {
   domain.setUpdatedDate(date);
 }
 public Date getUpdatedDate(DClass domain) {
   if (null == domain) {
     return null;
   }
   return domain.getUpdatedDate();
 }
 public void _setUpdatedBy(DClass domain, String updator) {
   domain.setUpdatedBy(updator);
 }
 public String getUpdatedBy(DClass domain) {
   if (null == domain) {
     return null;
   }
   return domain.getUpdatedBy();
 }
 public void _setCreatedBy(DClass domain, String creator) {
   domain.setCreatedBy(creator);
 }
 /** @return the simple key for specified DClass domain object */
 public void setSimpleKey(DClass domain, Long id) {
   domain.setId(id);
 }
 /** @return the simple key for specified DClass domain object */
 public Long getSimpleKey(DClass domain) {
   if (null == domain) {
     return null;
   }
   return domain.getId();
 }
 public void setParentKey(DClass domain, Object raceKey) {
   domain.setRaceKey((Serializable) raceKey);
 }
 public Object getParentKey(DClass domain) {
   return domain.getRaceKey();
 }