|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface ODataProducer
Implement ODataProducer on the server-side to create a new java-based OData producer.
The interface contains methods for clients to retrieve/query entities and to introspect service metadata (for read-only services) as well as methods to create/modify/delete entities (for read-write services).
Note that all client requests/responses are normalized - all details involving the OData http protocol, query expression model, EDM structure are handled by odata4j at a higher level.
| Method Summary | |
|---|---|
BaseResponse |
callFunction(EdmFunctionImport name,
Map<String,OFunctionParameter> params,
QueryInfo queryInfo)
Calls a function (aka Service Operation). |
void |
close()
Releases any resources managed by this producer. |
EntityResponse |
createEntity(String entitySetName,
OEntity entity)
Creates a new OData entity. |
EntityResponse |
createEntity(String entitySetName,
OEntityKey entityKey,
String navProp,
OEntity entity)
Creates a new OData entity as a reference of an existing entity, implicitly linked to the existing entity by a navigation property. |
void |
createLink(OEntityId sourceEntity,
String targetNavProp,
OEntityId targetEntity)
Creates a link between two entities. |
void |
deleteEntity(String entitySetName,
OEntityKey entityKey)
Deletes an existing entity. |
void |
deleteLink(OEntityId sourceEntity,
String targetNavProp,
OEntityKey targetEntityKey)
Deletes an existing link between two entities. |
EntitiesResponse |
getEntities(String entitySetName,
QueryInfo queryInfo)
Gets all the entities for a given set matching the query information. |
CountResponse |
getEntitiesCount(String entitySetName,
QueryInfo queryInfo)
Gets the count of all the entities for a given set matching the query information. |
EntityResponse |
getEntity(String entitySetName,
OEntityKey entityKey,
EntityQueryInfo queryInfo)
Obtains a single entity based on its type and key. |
EntityIdResponse |
getLinks(OEntityId sourceEntity,
String targetNavProp)
Returns the value of an entity's navigation property as a collection of entity links (or a single link if the association cardinality is 1). |
EdmDataServices |
getMetadata()
Obtains the service metadata for this producer. |
MetadataProducer |
getMetadataProducer()
Obtains the ODataProducer implementation that serves the metadata as OData EDM constructs. |
BaseResponse |
getNavProperty(String entitySetName,
OEntityKey entityKey,
String navProp,
QueryInfo queryInfo)
Given a specific entity, follow one of its navigation properties, applying constraints as appropriate. |
CountResponse |
getNavPropertyCount(String entitySetName,
OEntityKey entityKey,
String navProp,
QueryInfo queryInfo)
Given a specific entity, follow one of its navigation properties, applying constraints as appropriate. |
void |
mergeEntity(String entitySetName,
OEntity entity)
Modifies an existing entity using merge semantics. |
void |
updateEntity(String entitySetName,
OEntity entity)
Modifies an existing entity using update semantics. |
void |
updateLink(OEntityId sourceEntity,
String targetNavProp,
OEntityKey oldTargetEntityKey,
OEntityId newTargetEntity)
Replaces an existing link between two entities. |
| Methods inherited from interface org.odata4j.core.OExtensible |
|---|
findExtension |
| Method Detail |
|---|
BaseResponse callFunction(EdmFunctionImport name,
Map<String,OFunctionParameter> params,
QueryInfo queryInfo)
name - the name of the functionparams - the parameters to the functionqueryInfo - additional query parameters to apply to collection-valued results
The return type of <Function> MUST be one of the following:
An EDMSimpleType or collection of EDMSimpleTypes.
An entity type or collection of entity types.
A complex type or collection of complex types.
A row type or collection of row types.
<ReturnType> can contain a maximum of one <CollectionType> element.
<ReturnType> can contain a maximum of one <ReferenceType> element.
<ReturnType> can contain a maximum of one <RowType> element.
A ref type or collection of ref types.void close()
EntityResponse createEntity(String entitySetName,
OEntity entity)
entitySetName - the entity-set nameentity - the request entity sent from the client
EntityResponse createEntity(String entitySetName,
OEntityKey entityKey,
String navProp,
OEntity entity)
entitySetName - the entity-set name of the existing entityentityKey - the entity-key of the existing entitynavProp - the navigation property off of the existing entityentity - the request entity sent from the client
void createLink(OEntityId sourceEntity,
String targetNavProp,
OEntityId targetEntity)
sourceEntity - an entity with at least one navigation propertytargetNavProp - the navigation propertytargetEntity - the link target entity
void deleteEntity(String entitySetName,
OEntityKey entityKey)
entitySetName - the entity-set name of the entityentityKey - the entity-key of the entity
void deleteLink(OEntityId sourceEntity,
String targetNavProp,
OEntityKey targetEntityKey)
sourceEntity - an entity with at least one navigation propertytargetNavProp - the navigation propertytargetEntityKey - if the navigation property represents a set, the key identifying the target entity within the set, else n/a
EntitiesResponse getEntities(String entitySetName,
QueryInfo queryInfo)
entitySetName - the entity-set name for entities to returnqueryInfo - the additional constraints to apply to the entities
CountResponse getEntitiesCount(String entitySetName,
QueryInfo queryInfo)
entitySetName - the entity-set name for entities whose count is returnedqueryInfo - the additional constraints to apply to the entities
EntityResponse getEntity(String entitySetName,
OEntityKey entityKey,
EntityQueryInfo queryInfo)
entitySetName - the entity-set name for entities to returnentityKey - the unique entity-key of the entity to start withqueryInfo - the additional constraints applicable to single-entity queries
EntityIdResponse getLinks(OEntityId sourceEntity,
String targetNavProp)
sourceEntity - an entity with at least one navigation propertytargetNavProp - the navigation property
EdmDataServices getMetadata()
MetadataProducer getMetadataProducer()
BaseResponse getNavProperty(String entitySetName,
OEntityKey entityKey,
String navProp,
QueryInfo queryInfo)
entitySetName - the entity-set of the entity to start withentityKey - the unique entity-key of the entity to start withnavProp - the navigation property to followqueryInfo - additional constraints to apply to the result
CountResponse getNavPropertyCount(String entitySetName,
OEntityKey entityKey,
String navProp,
QueryInfo queryInfo)
entitySetName - the entity-set of the entity to start withentityKey - the unique entity-key of the entity to start withnavProp - the navigation property to followqueryInfo - additional constraints to apply to the result
void mergeEntity(String entitySetName,
OEntity entity)
entitySetName - the entity-set nameentity - the entity modifications sent from the client
void updateEntity(String entitySetName,
OEntity entity)
entitySetName - the entity-set nameentity - the entity modifications sent from the client
void updateLink(OEntityId sourceEntity,
String targetNavProp,
OEntityKey oldTargetEntityKey,
OEntityId newTargetEntity)
sourceEntity - an entity with at least one navigation propertytargetNavProp - the navigation propertyoldTargetEntityKey - if the navigation property represents a set, the key identifying the old target entity within the set, else n/anewTargetEntity - the new link target entity
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||