return containsProp;
}
private void applyProperties(Entity e, List<OProperty<?>> properties) {
for (OProperty<?> prop : properties) {
EdmType type = prop.getType();
if (!SUPPORTED_TYPES.contains(type)) {
throw new NotImplementedException("EdmType not supported: " + type);
}
Object value = prop.getValue();
if (type.equals(EdmSimpleType.STRING)) {
String sValue = (String) value;
if (sValue != null && sValue.length() > DataTypeUtils.MAX_STRING_PROPERTY_LENGTH) {
value = new Text(sValue);
}
} else if (type.equals(EdmSimpleType.BINARY)) {
byte[] bValue = (byte[]) value;
if (bValue != null) {
if (bValue.length > DataTypeUtils.MAX_SHORT_BLOB_PROPERTY_LENGTH) {
throw new RuntimeException("Bytes " + bValue.length + " exceeds the max supported length " + DataTypeUtils.MAX_SHORT_BLOB_PROPERTY_LENGTH);
}
value = new ShortBlob(bValue);
}
} else if (type.equals(EdmSimpleType.DATETIME)) {
LocalDateTime dValue = (LocalDateTime) value;
if (dValue != null) {
value = dValue.toDateTime().toDate(); // TODO review
}
}