org.odata4j.consumer
Class ConsumerEntityModificationRequest<T>

java.lang.Object
  extended by org.odata4j.consumer.AbstractConsumerEntityPayloadRequest
      extended by org.odata4j.consumer.ConsumerEntityModificationRequest<T>
All Implemented Interfaces:
OModifyRequest<T>

public class ConsumerEntityModificationRequest<T>
extends AbstractConsumerEntityPayloadRequest
implements OModifyRequest<T>

Modification-request implementation.


Field Summary
 
Fields inherited from class org.odata4j.consumer.AbstractConsumerEntityPayloadRequest
entitySetName, links, metadata, props, serviceRootUri
 
Constructor Summary
ConsumerEntityModificationRequest(T updateRoot, ODataClient client, String serviceRootUri, EdmDataServices metadata, String entitySetName, OEntityKey key, String ifMatch)
           
 
Method Summary
 void execute()
          Sends the modification request to the OData service.
 OModifyRequest<T> ifMatch(String precondition)
          Overrides the If-Match precondition.
 OModifyRequest<T> link(String navProperty, OEntity target)
          Defines an explicit link to another related entity.
 OModifyRequest<T> link(String navProperty, OEntityKey targetKey)
          Defines an explicit link to another related entity.
 OModifyRequest<T> nav(String navProperty, OEntityKey key)
          Selects a new modification entity by navigating to a referenced entity in a child collection.
 OModifyRequest<T> properties(Iterable<OProperty<?>> props)
          Sets properties on the new entity.
 OModifyRequest<T> properties(OProperty<?>... props)
          Sets properties on the new entity.
 
Methods inherited from class org.odata4j.consumer.AbstractConsumerEntityPayloadRequest
inline, link, link, properties, properties
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConsumerEntityModificationRequest

public ConsumerEntityModificationRequest(T updateRoot,
                                         ODataClient client,
                                         String serviceRootUri,
                                         EdmDataServices metadata,
                                         String entitySetName,
                                         OEntityKey key,
                                         String ifMatch)
Method Detail

execute

public void execute()
             throws ODataProducerException
Description copied from interface: OModifyRequest
Sends the modification request to the OData service.

Specified by:
execute in interface OModifyRequest<T>
Throws:
ODataProducerException - error from the producer

ifMatch

public OModifyRequest<T> ifMatch(String precondition)
Description copied from interface: OModifyRequest
Overrides the If-Match precondition.

The If-Match header will default to the entity-tag of the entity used to start the builder sequence.

Specified by:
ifMatch in interface OModifyRequest<T>
Parameters:
precondition - null, an entity-tag, or *
Returns:
the modification-request builder

link

public OModifyRequest<T> link(String navProperty,
                              OEntity target)
Description copied from interface: OModifyRequest
Defines an explicit link to another related entity.

Specified by:
link in interface OModifyRequest<T>
Parameters:
navProperty - the entity's relationship navigation property
target - the link target entity
Returns:
the modification-request builder

link

public OModifyRequest<T> link(String navProperty,
                              OEntityKey targetKey)
Description copied from interface: OModifyRequest
Defines an explicit link to another related entity.

Specified by:
link in interface OModifyRequest<T>
Parameters:
navProperty - the entity's relationship navigation property
targetKey - the key of the link target entity
Returns:
the modification-request builder

nav

public OModifyRequest<T> nav(String navProperty,
                             OEntityKey key)
Description copied from interface: OModifyRequest
Selects a new modification entity by navigating to a referenced entity in a child collection.

Specified by:
nav in interface OModifyRequest<T>
Parameters:
navProperty - the child collection
key - the referenced entity's key
Returns:
the modification-request builder

properties

public OModifyRequest<T> properties(Iterable<OProperty<?>> props)
Description copied from interface: OModifyRequest
Sets properties on the new entity.

Specified by:
properties in interface OModifyRequest<T>
Parameters:
props - the properties
Returns:
the modification-request builder

properties

public OModifyRequest<T> properties(OProperty<?>... props)
Description copied from interface: OModifyRequest
Sets properties on the new entity.

Specified by:
properties in interface OModifyRequest<T>
Parameters:
props - the properties
Returns:
the modification-request builder


http://odata4j.org