@Override public Object convertToAvro(DynamicTableEntity value) { try { if (COL_TIMESTAMP.equals(f.name()) || COL_TIMESTAMP.equals(mappedName)) { return value.getTimestamp(); } if (!value.getProperties().containsKey(mappedName) || value.getProperties().get(mappedName) == null) { return null; } return value.getProperties().get(mappedName).getValueAsDate(); } catch (Exception e) { LOGGER.error(i18nMessages.getMessage("error.ConversionError", e)); throw new ComponentException(e); } } }
@Override public Object convertToAvro(DynamicTableEntity value) { try { if (COL_TIMESTAMP.equals(f.name()) || COL_TIMESTAMP.equals(mappedName)) { return value.getTimestamp(); } if (!value.getProperties().containsKey(mappedName) || value.getProperties().get(mappedName) == null) { return null; } return value.getProperties().get(mappedName).getValueAsDate(); } catch (Exception e) { LOGGER.error(i18nMessages.getMessage("error.ConversionError", e)); throw new ComponentException(e); } } }
this.getValueAsDate(); this.edmType = EdmType.DATE_TIME;
this.getValueAsDate(); this.edmType = EdmType.DATE_TIME;
this.setter.invoke(instance, prop.getValueAsDate());
this.setter.invoke(instance, prop.getValueAsDate());
case DATE_TIME: Calendar value = new GregorianCalendar(); value.setTime(entry.getValue().getValueAsDate()); property = new Property(value); break;
this.getValueAsDate(); this.type = Date.class;
this.getValueAsDate(); this.type = Date.class;
if (tempProp != null) { tempProp.setDateBackwardCompatibility(false); timestamp = tempProp.getValueAsDate();
if (tempProp != null) { tempProp.setDateBackwardCompatibility(false); timestamp = tempProp.getValueAsDate();
assertEquals(date.getTime(), dynamicEntity.getProperties().get(dateKey).getValueAsDate().getTime()); options.setDateBackwardCompatibility(true); dynamicEntity = this.table.execute(get, options, null).getResultAsType(); assertEquals(date.getTime(), dynamicEntity.getProperties().get(dateKey).getValueAsDate().getTime());
assertEquals(expectedMilliseconds, dynamicEntity.getProperties().get(dateKey).getValueAsDate().getTime());