blob: 9d7777ae8d6f345d40206a6d6f7d8a37fc1e9270 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_92) on Wed Dec 06 14:36:23 CET 2017 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>org.apache.olingo.odata2.api.edm.provider (olingo-odata2-parent 2.0.10 API)</title>
<meta name="date" content="2017-12-06">
<link rel="stylesheet" type="text/css" href="../../../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="org.apache.olingo.odata2.api.edm.provider (olingo-odata2-parent 2.0.10 API)";
}
}
catch(err) {
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../../overview-summary.html">Overview</a></li>
<li class="navBarCell1Rev">Package</li>
<li>Class</li>
<li><a href="package-use.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../../../org/apache/olingo/odata2/api/edm/package-summary.html">Prev&nbsp;Package</a></li>
<li><a href="../../../../../../../org/apache/olingo/odata2/api/ep/package-summary.html">Next&nbsp;Package</a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../../../index.html?org/apache/olingo/odata2/api/edm/provider/package-summary.html" target="_top">Frames</a></li>
<li><a href="package-summary.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h1 title="Package" class="title">Package&nbsp;org.apache.olingo.odata2.api.edm.provider</h1>
<div class="docSummary">
<div class="block">Entity Data Model Provider API</div>
</div>
<p>See:&nbsp;<a href="#package.description">Description</a></p>
</div>
<div class="contentContainer">
<ul class="blockList">
<li class="blockList">
<table class="typeSummary" border="0" cellpadding="3" cellspacing="0" summary="Interface Summary table, listing interfaces, and an explanation">
<caption><span>Interface Summary</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Interface</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="../../../../../../../org/apache/olingo/odata2/api/edm/provider/EdmProviderAccessor.html" title="interface in org.apache.olingo.odata2.api.edm.provider">EdmProviderAccessor</a></td>
<td class="colLast">
<div class="block">This interface can be used to access the <a href="../../../../../../../org/apache/olingo/odata2/api/edm/provider/EdmProvider.html" title="class in org.apache.olingo.odata2.api.edm.provider"><code>EdmProvider</code></a> within an application.</div>
</td>
</tr>
</tbody>
</table>
</li>
<li class="blockList">
<table class="typeSummary" border="0" cellpadding="3" cellspacing="0" summary="Class Summary table, listing classes, and an explanation">
<caption><span>Class Summary</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Class</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="../../../../../../../org/apache/olingo/odata2/api/edm/provider/AliasInfo.html" title="class in org.apache.olingo.odata2.api.edm.provider">AliasInfo</a></td>
<td class="colLast">
<div class="block">Objects of this class hold an alias and the associated namespace</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../../../../org/apache/olingo/odata2/api/edm/provider/AnnotationAttribute.html" title="class in org.apache.olingo.odata2.api.edm.provider">AnnotationAttribute</a></td>
<td class="colLast">
<div class="block">Objects of this class represent an annotation attribute</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../../../../org/apache/olingo/odata2/api/edm/provider/AnnotationElement.html" title="class in org.apache.olingo.odata2.api.edm.provider">AnnotationElement</a></td>
<td class="colLast">
<div class="block">Objects of this class represent an annotation element.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../../../../org/apache/olingo/odata2/api/edm/provider/Association.html" title="class in org.apache.olingo.odata2.api.edm.provider">Association</a></td>
<td class="colLast">
<div class="block">Objects of this class represent an association</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../../../../org/apache/olingo/odata2/api/edm/provider/AssociationEnd.html" title="class in org.apache.olingo.odata2.api.edm.provider">AssociationEnd</a></td>
<td class="colLast">
<div class="block">Objects of this class represent an association end</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../../../../org/apache/olingo/odata2/api/edm/provider/AssociationSet.html" title="class in org.apache.olingo.odata2.api.edm.provider">AssociationSet</a></td>
<td class="colLast">
<div class="block">Objects of this class represent an association set</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../../../../org/apache/olingo/odata2/api/edm/provider/AssociationSetEnd.html" title="class in org.apache.olingo.odata2.api.edm.provider">AssociationSetEnd</a></td>
<td class="colLast">
<div class="block">Objects of this class represent an association set end</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../../../../org/apache/olingo/odata2/api/edm/provider/ComplexProperty.html" title="class in org.apache.olingo.odata2.api.edm.provider">ComplexProperty</a></td>
<td class="colLast">
<div class="block">Objects of this class represent a complex property.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../../../../org/apache/olingo/odata2/api/edm/provider/ComplexType.html" title="class in org.apache.olingo.odata2.api.edm.provider">ComplexType</a></td>
<td class="colLast">
<div class="block">Objects of this class represent a complex type</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../../../../org/apache/olingo/odata2/api/edm/provider/CustomizableFeedMappings.html" title="class in org.apache.olingo.odata2.api.edm.provider">CustomizableFeedMappings</a></td>
<td class="colLast">
<div class="block">Objects of this class represent customizable feed mappings.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../../../../org/apache/olingo/odata2/api/edm/provider/DataServices.html" title="class in org.apache.olingo.odata2.api.edm.provider">DataServices</a></td>
<td class="colLast">
<div class="block">Objects of this class represent the data service.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../../../../org/apache/olingo/odata2/api/edm/provider/Documentation.html" title="class in org.apache.olingo.odata2.api.edm.provider">Documentation</a></td>
<td class="colLast">
<div class="block">Objects of this class represent documentation</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../../../../org/apache/olingo/odata2/api/edm/provider/EdmProvider.html" title="class in org.apache.olingo.odata2.api.edm.provider">EdmProvider</a></td>
<td class="colLast">
<div class="block">Default EDM Provider which is to be extended by the application</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../../../../org/apache/olingo/odata2/api/edm/provider/EdmProviderFactory.html" title="class in org.apache.olingo.odata2.api.edm.provider">EdmProviderFactory</a></td>
<td class="colLast">
<div class="block">EDM Provider Factory which can be used to create an edm provider (e.g.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../../../../org/apache/olingo/odata2/api/edm/provider/EntityContainer.html" title="class in org.apache.olingo.odata2.api.edm.provider">EntityContainer</a></td>
<td class="colLast">
<div class="block">Objects of this class represent an entity container including its child elements</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../../../../org/apache/olingo/odata2/api/edm/provider/EntityContainerInfo.html" title="class in org.apache.olingo.odata2.api.edm.provider">EntityContainerInfo</a></td>
<td class="colLast">
<div class="block">Objects of this class represent an entity container</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../../../../org/apache/olingo/odata2/api/edm/provider/EntitySet.html" title="class in org.apache.olingo.odata2.api.edm.provider">EntitySet</a></td>
<td class="colLast">
<div class="block">Objects of this class represent an entity set</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../../../../org/apache/olingo/odata2/api/edm/provider/EntityType.html" title="class in org.apache.olingo.odata2.api.edm.provider">EntityType</a></td>
<td class="colLast">
<div class="block">Objects of this class represent an entity type</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../../../../org/apache/olingo/odata2/api/edm/provider/Facets.html" title="class in org.apache.olingo.odata2.api.edm.provider">Facets</a></td>
<td class="colLast">
<div class="block">Objects of this class represent the facets an entity type, property or function import can have</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../../../../org/apache/olingo/odata2/api/edm/provider/FunctionImport.html" title="class in org.apache.olingo.odata2.api.edm.provider">FunctionImport</a></td>
<td class="colLast">
<div class="block">Objects of this class represent a function import</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../../../../org/apache/olingo/odata2/api/edm/provider/FunctionImportParameter.html" title="class in org.apache.olingo.odata2.api.edm.provider">FunctionImportParameter</a></td>
<td class="colLast">
<div class="block">Objects of this class represent function import parameters</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../../../../org/apache/olingo/odata2/api/edm/provider/Key.html" title="class in org.apache.olingo.odata2.api.edm.provider">Key</a></td>
<td class="colLast">
<div class="block">Objects of this class represent a key for an entity type</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../../../../org/apache/olingo/odata2/api/edm/provider/Mapping.html" title="class in org.apache.olingo.odata2.api.edm.provider">Mapping</a></td>
<td class="colLast">
<div class="block">Object of this class represent the mapping of a value to a MIME type.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../../../../org/apache/olingo/odata2/api/edm/provider/NavigationProperty.html" title="class in org.apache.olingo.odata2.api.edm.provider">NavigationProperty</a></td>
<td class="colLast">
<div class="block">Objects of this Class represent a navigation property</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../../../../org/apache/olingo/odata2/api/edm/provider/OnDelete.html" title="class in org.apache.olingo.odata2.api.edm.provider">OnDelete</a></td>
<td class="colLast">
<div class="block">Objects of this class represent an OnDelete Action</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../../../../org/apache/olingo/odata2/api/edm/provider/Property.html" title="class in org.apache.olingo.odata2.api.edm.provider">Property</a></td>
<td class="colLast">
<div class="block">Objects of this class represent a property of an entity type</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../../../../org/apache/olingo/odata2/api/edm/provider/PropertyRef.html" title="class in org.apache.olingo.odata2.api.edm.provider">PropertyRef</a></td>
<td class="colLast">
<div class="block">Objects of this class represent a reference to a property via its name</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../../../../org/apache/olingo/odata2/api/edm/provider/ReferentialConstraint.html" title="class in org.apache.olingo.odata2.api.edm.provider">ReferentialConstraint</a></td>
<td class="colLast">
<div class="block">Objects of this Class represent a referential constraint</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../../../../org/apache/olingo/odata2/api/edm/provider/ReferentialConstraintRole.html" title="class in org.apache.olingo.odata2.api.edm.provider">ReferentialConstraintRole</a></td>
<td class="colLast">
<div class="block">Objects of this Class represent a referential constraint role</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../../../../org/apache/olingo/odata2/api/edm/provider/ReturnType.html" title="class in org.apache.olingo.odata2.api.edm.provider">ReturnType</a></td>
<td class="colLast">
<div class="block">Objects of this Class represent a return type of a function import</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../../../../org/apache/olingo/odata2/api/edm/provider/Schema.html" title="class in org.apache.olingo.odata2.api.edm.provider">Schema</a></td>
<td class="colLast">
<div class="block">Objects of this class represent a schema</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../../../../org/apache/olingo/odata2/api/edm/provider/SimpleProperty.html" title="class in org.apache.olingo.odata2.api.edm.provider">SimpleProperty</a></td>
<td class="colLast">
<div class="block">Objects of this class represent a simple property.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../../../../org/apache/olingo/odata2/api/edm/provider/Using.html" title="class in org.apache.olingo.odata2.api.edm.provider">Using</a></td>
<td class="colLast">&nbsp;</td>
</tr>
</tbody>
</table>
</li>
</ul>
<a name="package.description">
<!-- -->
</a>
<h2 title="Package org.apache.olingo.odata2.api.edm.provider Description">Package org.apache.olingo.odata2.api.edm.provider Description</h2>
<div class="block">Entity Data Model Provider API
<p>Classes in this package are used to provide an EDM to the library as well as to the application. To do this the
class <a href="../../../../../../../org/apache/olingo/odata2/api/edm/provider/EdmProvider.html" title="class in org.apache.olingo.odata2.api.edm.provider"><code>EdmProvider</code></a> has to be implemented.</p>
<p>Inside the OData library we are using a lazy loading concept which means the EdmProvider is only called for an
element if it is needed. See some sample coding for an EdmProvider below</p>
<p>public class Provider extends EdmProvider {
<p>public static final String NAMESPACE_1 = "RefScenario";
<br/>public static final String NAMESPACE_2 = "RefScenario2";
<br/>private static final FullQualifiedName ENTITY_TYPE_1_1 = new FullQualifiedName(NAMESPACE_1, "Employee");
<br/>private static final FullQualifiedName ENTITY_TYPE_1_BASE = new FullQualifiedName(NAMESPACE_1, "Base");
<br/>private static final FullQualifiedName ENTITY_TYPE_1_4 = new FullQualifiedName(NAMESPACE_1, "Manager");
<br/>private static final FullQualifiedName ENTITY_TYPE_2_1 = new FullQualifiedName(NAMESPACE_2, "Photo");
<br/>private static final FullQualifiedName COMPLEX_TYPE_1 = new FullQualifiedName(NAMESPACE_1, "c_Location");
<br/>private static final FullQualifiedName COMPLEX_TYPE_2 = new FullQualifiedName(NAMESPACE_1, "c_City");
<br/>private static final FullQualifiedName ASSOCIATION_1_1 = new FullQualifiedName(NAMESPACE_1, "ManagerEmployees");
<br/>private static final String ROLE_1_1 = "r_Employees";
<br/>private static final String ROLE_1_4 = "r_Manager";
<br/>private static final String ENTITY_CONTAINER_1 = "Container1";
<br/>private static final String ENTITY_CONTAINER_2 = "Container2";
<br/>private static final String ENTITY_SET_1_1 = "Employees";
<br/>private static final String ENTITY_SET_1_4 = "Managers";
<br/>private static final String ENTITY_SET_2_1 = "Photos";
<br/>private static final String FUNCTION_IMPORT_1 = "EmployeeSearch";
<br/>private static final String FUNCTION_IMPORT_2 = "AllLocations";
</p>
<p>public List<Schema> getSchemas() throws ODataException {
<p>List<Schema> schemas = new ArrayList<Schema>();
<br/>Schema schema = new Schema();
<br/>schema.setNamespace(NAMESPACE_1);
<br/>List<EntityType> entityTypes = new ArrayList<EntityType>();
<br/>entityTypes.add(getEntityType(ENTITY_TYPE_1_1));
<br/>entityTypes.add(getEntityType(ENTITY_TYPE_1_4));
<br/>entityTypes.add(getEntityType(ENTITY_TYPE_1_BASE));
<br/>schema.setEntityTypes(entityTypes);
<br/>List<ComplexType> complexTypes = new ArrayList<ComplexType>();
<br/>complexTypes.add(getComplexType(COMPLEX_TYPE_1));
<br/>complexTypes.add(getComplexType(COMPLEX_TYPE_2));
<br/>schema.setComplexTypes(complexTypes);
<br/>List<Association> associations = new ArrayList<Association>();
<br/>associations.add(getAssociation(ASSOCIATION_1_1));
<br/>schema.setAssociations(associations);
<br/>EntityContainer entityContainer = new EntityContainer();
<br/>entityContainer.setName(ENTITY_CONTAINER_1).setDefaultEntityContainer(true);
<br/>List<EntitySet> entitySets = new ArrayList<EntitySet>();
<br/>entitySets.add(getEntitySet(ENTITY_CONTAINER_1, ENTITY_SET_1_1));
<br/>entitySets.add(getEntitySet(ENTITY_CONTAINER_1, ENTITY_SET_1_4));
<br/>entityContainer.setEntitySets(entitySets);
<br/>List<AssociationSet> associationSets = new ArrayList<AssociationSet>();
<br/>associationSets.add(getAssociationSet(ENTITY_CONTAINER_1, ASSOCIATION_1_1, ENTITY_SET_1_4, ROLE_1_4));
<br/>entityContainer.setAssociationSets(associationSets);
<br/>List<FunctionImport> functionImports = new ArrayList<FunctionImport>();
<br/>functionImports.add(getFunctionImport(ENTITY_CONTAINER_1, FUNCTION_IMPORT_1));
<br/>functionImports.add(getFunctionImport(ENTITY_CONTAINER_1, FUNCTION_IMPORT_2));
<br/>entityContainer.setFunctionImports(functionImports);
<br/>schema.setEntityContainers(Arrays.asList(entityContainer));
<br/>schemas.add(schema);
</p>
<p>schema = new Schema();
<br/>schema.setNamespace(NAMESPACE_2);
<br/>schema.setEntityTypes(Arrays.asList(getEntityType(ENTITY_TYPE_2_1)));
<br/>entityContainer = new EntityContainer();
<br/>entityContainer.setName(ENTITY_CONTAINER_2);
<br/>entityContainer.setEntitySets(Arrays.asList(getEntitySet(ENTITY_CONTAINER_2, ENTITY_SET_2_1)));
<br/>schema.setEntityContainers(Arrays.asList(entityContainer));
<br/>schemas.add(schema);
</p>
<p>return schemas;</p>
}
<p>public EntityType getEntityType(FullQualifiedName edmFQName) throws ODataException {
<p>if (NAMESPACE_1.equals(edmFQName.getNamespace())) {
<br/>if (ENTITY_TYPE_1_1.getName().equals(edmFQName.getName())) {
<br/>List<Property> properties = new ArrayList<Property>();
<br/>properties.add(new SimpleProperty().setName("EmployeeId").setType(EdmSimpleTypeKind.String)
.setFacets(new Facets().setNullable(false))
.setMapping(new Mapping().setInternalName("getId")));
<br/>properties.add(new SimpleProperty().setName("EmployeeName").setType(EdmSimpleTypeKind.String)
.setCustomizableFeedMappings(new CustomizableFeedMappings()
.setFcTargetPath(EdmTargetPath.SYNDICATION_TITLE)));
<br/>properties.add(new SimpleProperty().setName("ManagerId").setType(EdmSimpleTypeKind.String)
.setMapping(new Mapping().setInternalName("getManager.getId")));
<br/>properties.add(new SimpleProperty().setName("RoomId").setType(EdmSimpleTypeKind.String)
.setMapping(new Mapping().setInternalName("getRoom.getId")));
<br/>properties.add(new SimpleProperty().setName("TeamId").setType(EdmSimpleTypeKind.String)
.setFacets(new Facets().setMaxLength(2))
.setMapping(new Mapping().setInternalName("getTeam.getId")));
<br/>properties.add(new ComplexProperty().setName("Location").setType(COMPLEX_TYPE_1)
.setFacets(new Facets().setNullable(false)));
<br/>properties.add(new SimpleProperty().setName("Age").setType(EdmSimpleTypeKind.Int16));
<br/>properties.add(new SimpleProperty().setName("EntryDate").setType(EdmSimpleTypeKind.DateTime)
.setFacets(new Facets().setNullable(true))
.setCustomizableFeedMappings(new CustomizableFeedMappings()
.setFcTargetPath(EdmTargetPath.SYNDICATION_UPDATED)));
<br/>properties.add(new SimpleProperty().setName("ImageUrl").setType(EdmSimpleTypeKind.String)
.setMapping(new Mapping().setInternalName("getImageUri")));
<br/>List<NavigationProperty> navigationProperties = new ArrayList<NavigationProperty>();
<br/>navigationProperties.add(new NavigationProperty().setName("ne_Manager")
.setRelationship(ASSOCIATION_1_1).setFromRole(ROLE_1_1).setToRole(ROLE_1_4));
<br/>return new EntityType().setName(ENTITY_TYPE_1_1.getName())
.setProperties(properties)
.setHasStream(true)
.setKey(getKey("EmployeeId"))
.setNavigationProperties(navigationProperties)
.setMapping(new Mapping().setMimeType("getImageType"));
<p>} else if (ENTITY_TYPE_1_BASE.getName().equals(edmFQName.getName())) {
<br/>List<Property> properties = new ArrayList<Property>();
<br/>properties.add(new SimpleProperty().setName("Id").setType(EdmSimpleTypeKind.String)
.setFacets(new Facets().setNullable(false).setDefaultValue("1")));
<br/>properties.add(new SimpleProperty().setName("Name").setType(EdmSimpleTypeKind.String)
.setCustomizableFeedMappings(new CustomizableFeedMappings()
.setFcTargetPath(EdmTargetPath.SYNDICATION_TITLE)));
<br/>return new EntityType().setName(ENTITY_TYPE_1_BASE.getName())
.setAbstract(true)
.setProperties(properties)
.setKey(getKey("Id"));
<p>} else if (ENTITY_TYPE_1_4.getName().equals(edmFQName.getName())) {
<br/>List<NavigationProperty> navigationProperties = new ArrayList<NavigationProperty>();
<br/>navigationProperties.add(new NavigationProperty().setName("nm_Employees")
.setRelationship(ASSOCIATION_1_1).setFromRole(ROLE_1_4).setToRole(ROLE_1_1));
<br/>return new EntityType().setName(ENTITY_TYPE_1_4.getName())
.setBaseType(ENTITY_TYPE_1_1)
.setHasStream(true)
.setNavigationProperties(navigationProperties)
.setMapping(new Mapping().setMimeType("getImageType"));
<p>} else if (NAMESPACE_2.equals(edmFQName.getNamespace())) {
<br/>if (ENTITY_TYPE_2_1.getName().equals(edmFQName.getName())) {
<br/>List<Property> properties = new ArrayList<Property>();
<br/>properties.add(new SimpleProperty().setName("Id").setType(EdmSimpleTypeKind.Int32)
.setFacets(new Facets().setNullable(false).setConcurrencyMode(EdmConcurrencyMode.Fixed)));
<br/>properties.add(new SimpleProperty().setName("Name").setType(EdmSimpleTypeKind.String)
.setCustomizableFeedMappings(new CustomizableFeedMappings()
.setFcTargetPath(EdmTargetPath.SYNDICATION_TITLE)));
<br/>properties.add(new SimpleProperty().setName("Type").setType(EdmSimpleTypeKind.String)
.setFacets(new Facets().setNullable(false)));
<br/>properties.add(new SimpleProperty().setName("ImageUrl").setType(EdmSimpleTypeKind.String)
.setCustomizableFeedMappings(new CustomizableFeedMappings()
.setFcTargetPath(EdmTargetPath.SYNDICATION_AUTHORURI))
.setMapping(new Mapping().setInternalName("getImageUri")));
<br/>properties.add(new SimpleProperty().setName("Image").setType(EdmSimpleTypeKind.Binary)
.setMapping(new Mapping().setMimeType("getImageType")));
<br/>properties.add(new SimpleProperty().setName("BinaryData").setType(EdmSimpleTypeKind.Binary)
.setFacets(new Facets().setNullable(true))
.setMimeType("image/jpeg"));
<br/>properties.add(new SimpleProperty().setName("Содержание").setType(EdmSimpleTypeKind.String)
.setFacets(new Facets().setNullable(true))
.setCustomizableFeedMappings(new CustomizableFeedMappings()
.setFcKeepInContent(false)
.setFcNsPrefix("ру") // CYRILLIC SMALL LETTER ER + CYRILLIC SMALL LETTER U
.setFcNsUri("http://localhost")
.setFcTargetPath("Содержание"))
.setMapping(new Mapping().setInternalName("getContent")));
<br/>return new EntityType().setName(ENTITY_TYPE_2_1.getName())
.setProperties(properties)
.setHasStream(true)
.setKey(getKey("Id", "Type"))
.setMapping(new Mapping().setMimeType("getType"));
}
}
}
<p>return null;
}
<p>public ComplexType getComplexType(FullQualifiedName edmFQName) throws ODataException {
<br/>if (NAMESPACE_1.equals(edmFQName.getNamespace()))
<br/>if (COMPLEX_TYPE_1.getName().equals(edmFQName.getName())) {
<br/>List<Property> properties = new ArrayList<Property>();
<br/>properties.add(new ComplexProperty().setName("City").setType(COMPLEX_TYPE_2));
<br/>properties.add(new SimpleProperty().setName("Country").setType(EdmSimpleTypeKind.String));
<br/>return new ComplexType().setName(COMPLEX_TYPE_1.getName()).setProperties(properties);
} <br/>else if (COMPLEX_TYPE_2.getName().equals(edmFQName.getName())) {
<br/>List<Property> properties = new ArrayList<Property>();
<br/>properties.add(new SimpleProperty().setName("PostalCode").setType(EdmSimpleTypeKind.String));
<br/>properties.add(new SimpleProperty().setName("CityName").setType(EdmSimpleTypeKind.String));
<br/>return new ComplexType().setName(COMPLEX_TYPE_2.getName()).setProperties(properties);
}
<br/>return null;
}
<p>public Association getAssociation(FullQualifiedName edmFQName) throws ODataException {
<br/>if (NAMESPACE_1.equals(edmFQName.getNamespace())) {
<br/>if (ASSOCIATION_1_1.getName().equals(edmFQName.getName())) {
<br/>return new Association().setName(ASSOCIATION_1_1.getName())
.setEnd1(new AssociationEnd().setType(ENTITY_TYPE_1_1).setRole(ROLE_1_1).setMultiplicity(EdmMultiplicity.MANY))
.setEnd2(new AssociationEnd().setType(ENTITY_TYPE_1_4).setRole(ROLE_1_4).setMultiplicity(EdmMultiplicity.ONE));
}
}
<br/>return null;
}
<p>public EntityContainerInfo getEntityContainerInfo(String name) throws ODataException {
<br/>if (name == null || ENTITY_CONTAINER_1.equals(name)) {
<br/>return new EntityContainerInfo().setName(ENTITY_CONTAINER_1).setDefaultEntityContainer(true);
} <br/>else if (ENTITY_CONTAINER_2.equals(name)) {
<br/>return new EntityContainerInfo().setName(name).setDefaultEntityContainer(false);
}
<br/>return null;
}
<p>public EntitySet getEntitySet(String entityContainer, String name) throws ODataException {
<br/>if (ENTITY_CONTAINER_1.equals(entityContainer)) {
<br/>if (ENTITY_SET_1_1.equals(name)) {
<br/>return new EntitySet().setName(name).setEntityType(ENTITY_TYPE_1_1);
}
} <br/>else if (ENTITY_CONTAINER_2.equals(entityContainer)) {
<br/>if (ENTITY_SET_2_1.equals(name)) {
<br/>return new EntitySet().setName(name).setEntityType(ENTITY_TYPE_2_1);
}
}
<br/>return null;
}
<p>public FunctionImport getFunctionImport(String entityContainer, String name) throws ODataException {
<br/>if (ENTITY_CONTAINER_1.equals(entityContainer)) {
<br/>if (FUNCTION_IMPORT_1.equals(name)) {
<br/>List<FunctionImportParameter> parameters = new ArrayList<FunctionImportParameter>();
<br/>parameters.add(new FunctionImportParameter().setName("q").setType(EdmSimpleTypeKind.String)
.setFacets(new Facets().setNullable(true)));
<br/>return new FunctionImport().setName(name)
.setReturnType(new ReturnType().setTypeName(ENTITY_TYPE_1_1).setMultiplicity(EdmMultiplicity.MANY))
.setEntitySet(ENTITY_SET_1_1)
.setHttpMethod("GET")
.setParameters(parameters);
} <br/>else if (FUNCTION_IMPORT_2.equals(name)) {
<br/>return new FunctionImport().setName(name)
.setReturnType(new ReturnType().setTypeName(COMPLEX_TYPE_1).setMultiplicity(EdmMultiplicity.MANY))
.setHttpMethod("GET");
}
}
<br/>return null;
}
<p>public AssociationSet getAssociationSet(String entityContainer, FullQualifiedName association, String
sourceEntitySetName, String sourceEntitySetRole) throws ODataException {
<br/>if (ENTITY_CONTAINER_1.equals(entityContainer))
<br/>if (ASSOCIATION_1_1.equals(association))
<br/>return new AssociationSet().setName(ASSOCIATION_1_1.getName())
.setAssociation(ASSOCIATION_1_1)
.setEnd1(new AssociationSetEnd().setRole(ROLE_1_4).setEntitySet(ENTITY_SET_1_4))
.setEnd2(new AssociationSetEnd().setRole(ROLE_1_1).setEntitySet(ENTITY_SET_1_1));
<br/>return null;
}
}
</p></div>
</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../../overview-summary.html">Overview</a></li>
<li class="navBarCell1Rev">Package</li>
<li>Class</li>
<li><a href="package-use.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../../../org/apache/olingo/odata2/api/edm/package-summary.html">Prev&nbsp;Package</a></li>
<li><a href="../../../../../../../org/apache/olingo/odata2/api/ep/package-summary.html">Next&nbsp;Package</a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../../../index.html?org/apache/olingo/odata2/api/edm/provider/package-summary.html" target="_top">Frames</a></li>
<li><a href="package-summary.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright &#169; 2013-2017 <a href="http://www.apache.org/">The Apache Software Foundation</a>. All Rights Reserved.</small></p>
</body>
</html>