org.odata4j.core
Interface OCreateRequest<T>

Type Parameters:
T - the entity representation as a java type
All Known Implementing Classes:
ConsumerCreateEntityRequest

public interface OCreateRequest<T>

A consumer-side create-request builder. Call execute() to issue the request.


Method Summary
 OCreateRequest<T> addToRelation(OEntity parent, String navProperty)
          Use a related parent entity's relationship collection to define an implicit link.
 T execute()
          Sends the create-request to the OData service and returns the newly created entity.
 T get()
          Returns a locally-built entity and does not send the create-request to the service.
 OCreateRequest<T> inline(String navProperty, Iterable<OEntity> entities)
          Create related entities inline as part of a single request.
 OCreateRequest<T> inline(String navProperty, OEntity... entities)
          Create related entities inline as part of a single request.
 OCreateRequest<T> link(String navProperty, OEntity target)
          Define an explicit link to another related entity.
 OCreateRequest<T> link(String navProperty, OEntityKey targetKey)
          Define an explicit link to another related entity.
 OCreateRequest<T> properties(Iterable<OProperty<?>> props)
          Set properties on the new entity.
 OCreateRequest<T> properties(OProperty<?>... props)
          Set properties on the new entity.
 

Method Detail

addToRelation

OCreateRequest<T> addToRelation(OEntity parent,
                                String navProperty)
Use a related parent entity's relationship collection to define an implicit link.

e.g. create a new Product entity using /Categories(10)/Products instead of /Products

Parameters:
parent - the parent entity
navProperty - the parent entity's relationship collection navigation property
Returns:
the create-request builder
See Also:
link(String, OEntity), http://www.odata.org/developers/protocols/operations#CreatingnewEntries

execute

T execute()
          throws ODataProducerException
Sends the create-request to the OData service and returns the newly created entity.

Returns:
newly created entity
Throws:
ODataProducerException - error from the producer

get

T get()
Returns a locally-built entity and does not send the create-request to the service. The locally-built entity can be used inline as part of other create-requests.

Returns:
new locally built entity
See Also:
inline(String, OEntity...)

inline

OCreateRequest<T> inline(String navProperty,
                         Iterable<OEntity> entities)
Create related entities inline as part of a single request.

Parameters:
navProperty - the new entity's relationship navigation property
entities - related entities, returned by get()
Returns:
the create-request builder
See Also:
get()

inline

OCreateRequest<T> inline(String navProperty,
                         OEntity... entities)
Create related entities inline as part of a single request.

Parameters:
navProperty - the new entity's relationship navigation property
entities - related entities, returned by get()
Returns:
the create-request builder
See Also:
get()

link

OCreateRequest<T> link(String navProperty,
                       OEntity target)
Define an explicit link to another related entity.

Parameters:
navProperty - the new entity's relationship navigation property
target - the link target entity
Returns:
the create-request builder
See Also:
addToRelation(OEntity, String), http://www.odata.org/developers/protocols/operations#CreatingnewEntries

link

OCreateRequest<T> link(String navProperty,
                       OEntityKey targetKey)
Define an explicit link to another related entity.

Parameters:
navProperty - the new entity's relationship navigation property
targetKey - the key of the link target entity
Returns:
the create-request builder
See Also:
addToRelation(OEntity, String), http://www.odata.org/developers/protocols/operations#CreatingnewEntries

properties

OCreateRequest<T> properties(Iterable<OProperty<?>> props)
Set properties on the new entity.

Parameters:
props - the properties
Returns:
the create-request builder

properties

OCreateRequest<T> properties(OProperty<?>... props)
Set properties on the new entity.

Parameters:
props - the properties
Returns:
the create-request builder


http://odata4j.org