@Override
 public void updateEntityPostWrite(DCompetition entity, Object key, Object value) {
   entity.setId(supplier.toLongKey(key));
   entity.setCreatedBy(supplier.getString(value, Field.CREATEDBY.getFieldName()));
   entity.setCreatedDate(supplier.getDate(value, Field.CREATEDDATE.getFieldName()));
   entity.setUpdatedBy(supplier.getString(value, Field.UPDATEDBY.getFieldName()));
   entity.setUpdatedDate(supplier.getDate(value, Field.UPDATEDDATE.getFieldName()));
 }
  @Override
  public Object toWriteValue(DCompetition entity) {
    final Long id = getId(entity);
    final Object parentKey = getParentKey(entity);
    final Object value = supplier.createWriteValue(parentKey, getKind(), id);

    // set all fields:
    supplier.setLong(value, Field.ADMINID.getFieldName(), entity.getAdminId());
    supplier.setDate(value, Field.BEGINDATE.getFieldName(), entity.getBeginDate());
    supplier.setString(value, Field.CREATEDBY.getFieldName(), entity.getCreatedBy());
    supplier.setDate(value, Field.CREATEDDATE.getFieldName(), entity.getCreatedDate());
    supplier.setDate(value, Field.ENDDATE.getFieldName(), entity.getEndDate());
    supplier.setString(value, Field.TITLE.getFieldName(), entity.getTitle());
    supplier.setString(value, Field.UPDATEDBY.getFieldName(), entity.getUpdatedBy());
    supplier.setDate(value, Field.UPDATEDDATE.getFieldName(), entity.getUpdatedDate());
    supplier.setString(value, Field.URL.getFieldName(), entity.getUrl());
    return value;
  }
  @Override
  public DCompetition fromReadValue(Object value) {
    final DCompetition entity = new DCompetition();

    // set primary key:
    final Object key = supplier.getKey(value, Field.ID.getFieldName());
    entity.setId(supplier.toLongKey(key));

    // set all fields:
    entity.setAdminId(supplier.getLong(value, Field.ADMINID.getFieldName()));
    entity.setBeginDate(supplier.getDate(value, Field.BEGINDATE.getFieldName()));
    entity.setCreatedBy(supplier.getString(value, Field.CREATEDBY.getFieldName()));
    entity.setCreatedDate(supplier.getDate(value, Field.CREATEDDATE.getFieldName()));
    entity.setEndDate(supplier.getDate(value, Field.ENDDATE.getFieldName()));
    entity.setTitle(supplier.getString(value, Field.TITLE.getFieldName()));
    entity.setUpdatedBy(supplier.getString(value, Field.UPDATEDBY.getFieldName()));
    entity.setUpdatedDate(supplier.getDate(value, Field.UPDATEDDATE.getFieldName()));
    entity.setUrl(supplier.getString(value, Field.URL.getFieldName()));
    return entity;
  }
 @Override
 public Long fromKey(Object key) {
   return supplier.toLongKey(key);
 }
 @Override
 public Object toKey(Object parentKey, Long id) {
   return supplier.toKey(parentKey, getKind(), id);
 }