@Override public boolean add(final ClientEntity entity, final ClientProperty property) { return entity.getProperties().add(property); }
@Override public boolean add(final ClientEntity entity, final ClientProperty property) { return entity.getProperties().add(property); }
public static void addProperties( final EdmEnabledODataClient client, final Map<String, Object> changes, final ClientEntity entity) { for (Map.Entry<String, Object> entry : changes.entrySet()) { entity.getProperties() .add(getODataEntityProperty(client, entity.getTypeName(), entry.getKey(), entry.getValue())); } }
public static void addProperties( final EdmEnabledODataClient client, final Map<String, Object> changes, final ClientEntity entity) { for (Map.Entry<String, Object> entry : changes.entrySet()) { entity.getProperties() .add(getODataEntityProperty(client, entity.getTypeName(), entry.getKey(), entry.getValue())); } }
@Override @SuppressWarnings("unchecked") protected <T extends ClientProperty> List<T> getInternalProperties() { return getEntity() == null ? Collections.<T> emptyList() : (List<T>) getEntity().getProperties(); }
@Override @SuppressWarnings("unchecked") protected <T extends ClientProperty> List<T> getInternalProperties() { return getEntity() == null ? Collections.<T> emptyList() : (List<T>) getEntity().getProperties(); }
public static Object getKey( final EdmEnabledODataClient client, final EntityInvocationHandler typeHandler, final Class<?> entityTypeRef, final ClientEntity entity) { Object res = null; if (!entity.getProperties().isEmpty()) { final Class<?> keyRef = ClassUtils.getCompoundKeyRef(entityTypeRef); if (keyRef == null) { final ClientProperty property = entity.getProperty(firstValidEntityKey(entityTypeRef)); if (property != null && property.hasPrimitiveValue()) { res = primitiveValueToObject( property.getPrimitiveValue(), getPropertyClass(entityTypeRef, property.getName())); } } else { try { res = keyRef.newInstance(); populate(client, typeHandler, res, CompoundKeyElement.class, entity.getProperties().iterator()); } catch (Exception e) { LOG.error("Error population compound key {}", keyRef.getSimpleName(), e); throw new IllegalArgumentException("Cannot populate compound key"); } } } return res; }
public static Object getKey( final EdmEnabledODataClient client, final EntityInvocationHandler typeHandler, final Class<?> entityTypeRef, final ClientEntity entity) { Object res = null; if (!entity.getProperties().isEmpty()) { final Class<?> keyRef = ClassUtils.getCompoundKeyRef(entityTypeRef); if (keyRef == null) { final ClientProperty property = entity.getProperty(firstValidEntityKey(entityTypeRef)); if (property != null && property.hasPrimitiveValue()) { res = primitiveValueToObject( property.getPrimitiveValue(), getPropertyClass(entityTypeRef, property.getName())); } } else { try { res = keyRef.newInstance(); populate(client, typeHandler, res, CompoundKeyElement.class, entity.getProperties().iterator()); } catch (Exception e) { LOG.error("Error population compound key {}", keyRef.getSimpleName(), e); throw new IllegalArgumentException("Cannot populate compound key"); } } } return res; }
entity.getProperties().clear(); CoreUtils.addProperties(service.getClient(), handler.getPropertyChanges(), entity);
entity.getProperties().clear(); CoreUtils.addProperties(service.getClient(), handler.getPropertyChanges(), entity);
for (ClientProperty property : odataEntity.getProperties()) { entity.getProperties().add(getProperty(property));
for (ClientProperty property : odataEntity.getProperties()) { entity.getProperties().add(getProperty(property));