public interface

OCreateRequest

org.odata4j.core.OCreateRequest<T>

Class Overview

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

Summary

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

Public Methods

public abstract 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

public abstract T execute (String serviceUri)

Sends the create-request to the OData service and returns the newly created entity.

Parameters
serviceUri
Returns
  • newly created entity

public abstract 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...)

public abstract ODataClientRequest getRawRequest (String serviceUri)

Returns the low level, not yet executed OData request

Parameters
serviceUri

public abstract 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

public abstract 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

public abstract 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

public abstract OCreateRequest<T> properties (Iterable<OProperty<?>> props)

Set properties on the new entity.

Parameters
props The properties
Returns
  • the create-request builder

public abstract OCreateRequest<T> properties (OProperty...<?> props)

Set properties on the new entity.

Parameters
props The properties
Returns
  • the create-request builder