@Override protected void setDomainProperty(final DRace domain, final String name, final Object value) { // simple key? if (COLUMN_NAME_ID.equals(name)) { domain.setId((java.lang.Long) value); } // fields 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_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_SERIES.equals(name)) { DSeries foreign = null; if (null != value) { foreign = seriesDao.createDomain(value); } domain.setSeries(foreign); } // many-to-manys else { super.setDomainProperty(domain, name, value); } }
/** Overrides to substitute Entity properties with foreign keys */ @Override protected void setCoreProperty(Object core, String name, Object value) { if (null == core || null == name) { return; } else if (null == value) { // do nothing in particular, will call super at end } else if (COLUMN_NAME_SERIES.equals(name)) { // many-to-one: replace foreign entity with its primary key DSeries foreign = (DSeries) value; value = seriesDao.getPrimaryKey(foreign); } super.setCoreProperty(core, name, value); }
@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); } }