Java Code Examples for org.apache.olingo.odata2.api.edm.provider.EntityContainer#setName()
The following examples show how to use
org.apache.olingo.odata2.api.edm.provider.EntityContainer#setName() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AnnotationEdmProvider.java From olingo-odata2 with Apache License 2.0 | 5 votes |
public EntityContainer build() { EntityContainer ec = new EntityContainer(); ec.setName(name); ec.setDefaultEntityContainer(defaultContainer); ec.setEntitySets(entitySets); ec.setAssociationSets(associationSets); ec.setFunctionImports(functionImports); return ec; }
Example 2
Source File: EdmSchemaMock.java From olingo-odata2 with Apache License 2.0 | 5 votes |
private static List<EntityContainer> createEntityContainer() { List<EntityContainer> entityContainers = new ArrayList<EntityContainer>(); EntityContainer entityContainer = new EntityContainer(); entityContainer.setDefaultEntityContainer(true); entityContainer.setName(ENTITY_CONTAINER_NAME); entityContainer.setEntitySets(createEntitySets()); entityContainer.setAssociationSets(createAssociationSets()); entityContainer.setFunctionImports(createFunctionImports()); entityContainers.add(entityContainer); return entityContainers; }
Example 3
Source File: XmlMetadataConsumer.java From olingo-odata2 with Apache License 2.0 | 4 votes |
private EntityContainer readEntityContainer(final XMLStreamReader reader) throws XMLStreamException, EntityProviderException { reader.require(XMLStreamConstants.START_ELEMENT, edmNamespace, XmlMetadataConstants.EDM_ENTITY_CONTAINER); EntityContainer container = new EntityContainer(); List<EntitySet> entitySets = new ArrayList<EntitySet>(); List<AssociationSet> associationSets = new ArrayList<AssociationSet>(); List<FunctionImport> functionImports = new ArrayList<FunctionImport>(); List<AnnotationElement> annotationElements = new ArrayList<AnnotationElement>(); container.setName(reader.getAttributeValue(null, XmlMetadataConstants.EDM_NAME)); if (reader.getAttributeValue(Edm.NAMESPACE_M_2007_08, XmlMetadataConstants.EDM_CONTAINER_IS_DEFAULT) != null) { container.setDefaultEntityContainer("true".equalsIgnoreCase(reader.getAttributeValue(Edm.NAMESPACE_M_2007_08, "IsDefaultEntityContainer"))); } container.setExtendz(reader.getAttributeValue(null, XmlMetadataConstants.EDM_CONTAINER_EXTENDZ)); container.setAnnotationAttributes(readAnnotationAttribute(reader)); while (reader.hasNext() && !(reader.isEndElement() && edmNamespace.equals(reader.getNamespaceURI()) && XmlMetadataConstants.EDM_ENTITY_CONTAINER.equals(reader.getLocalName()))) { reader.next(); if (reader.isStartElement()) { extractNamespaces(reader); currentHandledStartTagName = reader.getLocalName(); if (XmlMetadataConstants.EDM_ENTITY_SET.equals(currentHandledStartTagName)) { entitySets.add(readEntitySet(reader)); } else if (XmlMetadataConstants.EDM_ASSOCIATION_SET.equals(currentHandledStartTagName)) { associationSets.add(readAssociationSet(reader)); } else if (XmlMetadataConstants.EDM_FUNCTION_IMPORT.equals(currentHandledStartTagName)) { functionImports.add(readFunctionImport(reader)); } else { annotationElements.add(readAnnotationElement(reader)); } } } if (!annotationElements.isEmpty()) { container.setAnnotationElements(annotationElements); } container.setEntitySets(entitySets).setAssociationSets(associationSets).setFunctionImports(functionImports); edmFunctionImportList.addAll(functionImports); containerMap.put(new FullQualifiedName(currentNamespace, container.getName()), container); return container; }
Example 4
Source File: MapProvider.java From olingo-odata2 with Apache License 2.0 | 4 votes |
private void buildSchema() { propertyRef = new PropertyRef(); propertyRef.setName("p1"); key = new Key(); key.setKeys(Arrays.asList(propertyRef)); property1 = new SimpleProperty().setName(mapping[P1][EDM]).setType(EdmSimpleTypeKind.String).setMapping( new Mapping().setObject(mapping[P1][BACKEND])); property2 = new SimpleProperty().setName(mapping[P2][EDM]).setType(EdmSimpleTypeKind.String).setMapping( new Mapping().setObject(mapping[P2][BACKEND])); property3 = new SimpleProperty().setName(mapping[P3][EDM]).setType(EdmSimpleTypeKind.String).setMapping( new Mapping().setObject(mapping[P3][BACKEND])); entityType = new EntityType(); entityType.setName(mapping[ENTITYTYPE][EDM]); entityType.setKey(key); entityType.setProperties(Arrays.asList(property1, property2, property3)); entityType.setMapping(new Mapping().setObject(mapping[ENTITYTYPE][BACKEND])); entitySet = new EntitySet(); entitySet.setName(mapping[ENTITYSET][EDM]); entitySet.setEntityType(new FullQualifiedName(NAMESPACE, mapping[ENTITYTYPE][EDM])); entitySet.setMapping(new Mapping().setObject(mapping[ENTITYSET][BACKEND])); entityContainer = new EntityContainer(); entityContainer.setDefaultEntityContainer(true); entityContainer.setName(MAPPING_CONTAINER); entityContainer.setEntitySets(Arrays.asList(entitySet)); schema = new Schema(); schema.setNamespace("mapping"); schema.setAlias(NAMESPACE); schema.setEntityContainers(Arrays.asList(entityContainer)); schema.setEntityTypes(Arrays.asList(entityType)); schemas = Arrays.asList(schema); }