/** * Creates an entity-id. * * @param entitySetName the entity-set * @param entityKeyValues the entity-key as one or more values * @return the entity-id */ public static OEntityId create(String entitySetName, Object... entityKeyValues) { return create(entitySetName, OEntityKey.create(entityKeyValues)); }
/** * Creates an entity-id. * * @param entitySetName the entity-set * @param entityKeyValues the entity-key as one or more values * @return the entity-id */ public static OEntityId create(String entitySetName, Object... entityKeyValues) { return create(entitySetName, OEntityKey.create(entityKeyValues)); }
/** * Creates an entity-id. * * @param entitySetName the entity-set * @param entityKeyValues the entity-key as one or more values * @return the entity-id */ public static OEntityId create(String entitySetName, Object... entityKeyValues) { return create(entitySetName, OEntityKey.create(entityKeyValues)); }
/** * Creates an entity-key from a map of names and values. * * @param values the map of names and values * @return a newly-created entity-key */ public static OEntityKey create(Map<String, Object> values) { return create(NamedValues.fromMap(values)); }
public String apply(String input) { String keyString = targetKeyValues == null || targetKeyValues.length == 0 ? "" : OEntityKey.create(targetKeyValues).toKeyString(); return input + "/$links/" + targetNavProp + keyString; } };
public String apply(String input) { String keyString = targetKeyValues == null || targetKeyValues.length == 0 ? "" : OEntityKey.create(targetKeyValues).toKeyString(); return input + "/$links/" + targetNavProp + keyString; } };
/** * Creates an entity-key from a map of names and values. * * @param values the map of names and values * @return a newly-created entity-key */ public static OEntityKey create(Map<String, Object> values) { return create(NamedValues.fromMap(values)); }
/** * Creates an entity-key from a map of names and values. * * @param values the map of names and values * @return a newly-created entity-key */ public static OEntityKey create(Map<String, Object> values) { return create(NamedValues.fromMap(values)); }
@Override public OQueryRequest<T> nav(Object keyValue, String navProperty) { return nav(OEntityKey.create(keyValue), navProperty); }
@Override public OQueryRequest<T> nav(Object keyValue, String navProperty) { return nav(OEntityKey.create(keyValue), navProperty); }
public OEntityGetRequest<OEntity> getEntity(String entitySetName, Object keyValue) { return getEntity(entitySetName, OEntityKey.create(keyValue)); }
public OEntityDeleteRequest deleteEntity(String entitySetName, Object keyValue) { return deleteEntity(entitySetName, OEntityKey.create(keyValue)); }
public <T> OEntityGetRequest<T> getEntity(Class<T> entityType, String entitySetName, Object keyValue) { return getEntity(entityType, entitySetName, OEntityKey.create(keyValue)); }
public OEntityDeleteRequest deleteEntity(String entitySetName, Object keyValue) { return deleteEntity(entitySetName, OEntityKey.create(keyValue)); }
public OModifyRequest<OEntity> mergeEntity(String entitySetName, Object keyValue) { return mergeEntity(entitySetName, OEntityKey.create(keyValue)); }
public OModifyRequest<OEntity> mergeEntity(String entitySetName, Object keyValue) { return mergeEntity(entitySetName, OEntityKey.create(keyValue)); }
public <T> OEntityGetRequest<T> getEntity(Class<T> entityType, String entitySetName, Object keyValue) { return getEntity(entityType, entitySetName, OEntityKey.create(keyValue)); }
static OEntityKey toOEntityKey(Object jpaEntity, SingularAttribute<?, ?> idAtt) { boolean hasEmbeddedCompositeKey = idAtt.getPersistentAttributeType() == PersistentAttributeType.EMBEDDED; if (!hasEmbeddedCompositeKey) { Object id = SetResponseCommand.getIdValue(jpaEntity, idAtt, null); return OEntityKey.create(id); } ManagedType<?> keyType = (ManagedType<?>) idAtt.getType(); Map<String, Object> nameValues = new HashMap<String, Object>(); for (Attribute<?, ?> att : keyType.getAttributes()) nameValues.put(att.getName(), SetResponseCommand.getIdValue(jpaEntity, idAtt, att.getName())); return OEntityKey.create(nameValues); }
public <T> OEntityGetRequest<T> getEntity(Class<T> entityType, String entitySetName, OEntityKey key) { return new ConsumerGetEntityRequest<T>(getClient(), entityType, getServiceRootUri(), getMetadata(), entitySetName, OEntityKey.create(key)); }
public <T> OEntityGetRequest<T> getEntity(Class<T> entityType, String entitySetName, OEntityKey key) { return new ConsumerGetEntityRequest<T>(getClient(), entityType, getServiceRootUri(), getMetadata(), entitySetName, OEntityKey.create(key)); }