org.apache.olingo.commons.api.edm.provider.CsdlEntityContainerInfo Java Examples
The following examples show how to use
org.apache.olingo.commons.api.edm.provider.CsdlEntityContainerInfo.
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: EdmSingletonImplTest.java From olingo-odata4 with Apache License 2.0 | 6 votes |
@Test(expected = EdmException.class) public void wrongTarget() throws Exception { CsdlEdmProvider provider = mock(CsdlEdmProvider.class); EdmProviderImpl edm = new EdmProviderImpl(provider); final FullQualifiedName containerName = new FullQualifiedName("ns", "container"); final CsdlEntityContainerInfo containerInfo = new CsdlEntityContainerInfo().setContainerName(containerName); when(provider.getEntityContainerInfo(containerName)).thenReturn(containerInfo); final String singletonName = "singleton"; final CsdlSingleton singletonProvider = new CsdlSingleton() .setNavigationPropertyBindings(Arrays.asList( new CsdlNavigationPropertyBinding().setPath("path") .setTarget(containerName.getFullQualifiedNameAsString() + "/wrong"))); when(provider.getSingleton(containerName, singletonName)).thenReturn(singletonProvider); final EdmSingleton singleton = new EdmSingletonImpl(edm, null, singletonProvider); singleton.getRelatedBindingTarget("path"); }
Example #2
Source File: CrossServiceTest.java From olingo-odata4 with Apache License 2.0 | 6 votes |
@Override public CsdlEntityContainerInfo getEntityContainerInfo(final FullQualifiedName entityContainerName) throws ODataException { if (entityContainerName == null) { return new CsdlEntityContainerInfo().setContainerName( new FullQualifiedName(namespace, CONTAINER_PREFIX + name)); } else if (namespace.equals(entityContainerName.getNamespace())) { if ((CONTAINER_PREFIX + name).equals(entityContainerName.getName())) { return new CsdlEntityContainerInfo().setContainerName(entityContainerName); } return null; } else if ((NAMESPACE_PREFIX + other).equals(entityContainerName.getNamespace())) { final CsdlEdmProvider otherProvider = this == provider1 ? provider2 : provider1; return otherProvider.getEntityContainerInfo(entityContainerName); } return null; }
Example #3
Source File: DemoEdmProvider.java From olingo-odata4 with Apache License 2.0 | 5 votes |
@Override public CsdlEntityContainerInfo getEntityContainerInfo(FullQualifiedName entityContainerName) { // This method is invoked when displaying the service document at // e.g. http://localhost:8080/DemoService/DemoService.svc if (entityContainerName == null || entityContainerName.equals(CONTAINER)) { CsdlEntityContainerInfo entityContainerInfo = new CsdlEntityContainerInfo(); entityContainerInfo.setContainerName(CONTAINER); return entityContainerInfo; } return null; }
Example #4
Source File: DemoEdmProvider.java From olingo-odata4 with Apache License 2.0 | 5 votes |
@Override public CsdlEntityContainerInfo getEntityContainerInfo(FullQualifiedName entityContainerName) { // This method is invoked when displaying the service document at // e.g. http://localhost:8080/DemoService/DemoService.svc if(entityContainerName == null || entityContainerName.equals(CONTAINER)){ CsdlEntityContainerInfo entityContainerInfo = new CsdlEntityContainerInfo(); entityContainerInfo.setContainerName(CONTAINER); return entityContainerInfo; } return null; }
Example #5
Source File: DemoEdmProvider.java From olingo-odata4 with Apache License 2.0 | 5 votes |
@Override public CsdlEntityContainerInfo getEntityContainerInfo(FullQualifiedName entityContainerName) { // This method is invoked when displaying the service document at // e.g. http://localhost:8080/DemoService/DemoService.svc if(entityContainerName == null || entityContainerName.equals(CONTAINER)){ CsdlEntityContainerInfo entityContainerInfo = new CsdlEntityContainerInfo(); entityContainerInfo.setContainerName(CONTAINER); return entityContainerInfo; } return null; }
Example #6
Source File: DemoEdmProvider.java From olingo-odata4 with Apache License 2.0 | 5 votes |
@Override public CsdlEntityContainerInfo getEntityContainerInfo(FullQualifiedName entityContainerName) { // This method is invoked when displaying the service document at // e.g. http://localhost:8080/DemoService/DemoService.svc if (entityContainerName == null || entityContainerName.equals(CONTAINER)) { CsdlEntityContainerInfo entityContainerInfo = new CsdlEntityContainerInfo(); entityContainerInfo.setContainerName(CONTAINER); return entityContainerInfo; } return null; }
Example #7
Source File: DemoEdmProvider.java From olingo-odata4 with Apache License 2.0 | 5 votes |
@Override public CsdlEntityContainerInfo getEntityContainerInfo(FullQualifiedName entityContainerName) { // This method is invoked when displaying the service document at // e.g. http://localhost:8080/DemoService/DemoService.svc if (entityContainerName == null || entityContainerName.equals(CONTAINER)) { CsdlEntityContainerInfo entityContainerInfo = new CsdlEntityContainerInfo(); entityContainerInfo.setContainerName(CONTAINER); return entityContainerInfo; } return null; }
Example #8
Source File: DemoEdmProvider.java From olingo-odata4 with Apache License 2.0 | 5 votes |
@Override public CsdlEntityContainerInfo getEntityContainerInfo(FullQualifiedName entityContainerName) { // This method is invoked when displaying the service document at // e.g. http://localhost:8080/DemoService/DemoService.svc if (entityContainerName == null || entityContainerName.equals(CONTAINER)) { CsdlEntityContainerInfo entityContainerInfo = new CsdlEntityContainerInfo(); entityContainerInfo.setContainerName(CONTAINER); return entityContainerInfo; } return null; }
Example #9
Source File: DemoEdmProvider.java From olingo-odata4 with Apache License 2.0 | 5 votes |
@Override public CsdlEntityContainerInfo getEntityContainerInfo(FullQualifiedName entityContainerName) { // This method is invoked when displaying the service document at // e.g. http://localhost:8080/DemoService/DemoService.svc if (entityContainerName == null || entityContainerName.equals(CONTAINER)) { CsdlEntityContainerInfo entityContainerInfo = new CsdlEntityContainerInfo(); entityContainerInfo.setContainerName(CONTAINER); return entityContainerInfo; } return null; }
Example #10
Source File: DemoEdmProvider.java From olingo-odata4 with Apache License 2.0 | 5 votes |
@Override public CsdlEntityContainerInfo getEntityContainerInfo(FullQualifiedName entityContainerName) { // This method is invoked when displaying the service document // at e.g. http://localhost:8080/DemoService/DemoService.svc if(entityContainerName == null || entityContainerName.equals(CONTAINER)){ CsdlEntityContainerInfo entityContainerInfo = new CsdlEntityContainerInfo(); entityContainerInfo.setContainerName(CONTAINER); return entityContainerInfo; } return null; }
Example #11
Source File: DemoEdmProvider.java From olingo-odata4 with Apache License 2.0 | 5 votes |
@Override public CsdlEntityContainerInfo getEntityContainerInfo(FullQualifiedName entityContainerName) { // This method is invoked when displaying the service document at e.g. http://localhost:8080/DemoService/DemoService.svc if(entityContainerName == null || entityContainerName.equals(CONTAINER)){ CsdlEntityContainerInfo entityContainerInfo = new CsdlEntityContainerInfo(); entityContainerInfo.setContainerName(CONTAINER); return entityContainerInfo; } return null; }
Example #12
Source File: DemoEdmProvider.java From olingo-odata4 with Apache License 2.0 | 5 votes |
@Override public CsdlEntityContainerInfo getEntityContainerInfo(FullQualifiedName entityContainerName) { // This method is invoked when displaying the service document at // e.g. http://localhost:8080/DemoService/DemoService.svc if (entityContainerName == null || entityContainerName.equals(CONTAINER)) { CsdlEntityContainerInfo entityContainerInfo = new CsdlEntityContainerInfo(); entityContainerInfo.setContainerName(CONTAINER); return entityContainerInfo; } return null; }
Example #13
Source File: DemoEdmProvider.java From olingo-odata4 with Apache License 2.0 | 5 votes |
@Override public CsdlEntityContainerInfo getEntityContainerInfo(FullQualifiedName entityContainerName) { // This method is invoked when displaying the service document at // e.g. http://localhost:8080/DemoService/DemoService.svc if (entityContainerName == null || entityContainerName.equals(CONTAINER)) { CsdlEntityContainerInfo entityContainerInfo = new CsdlEntityContainerInfo(); entityContainerInfo.setContainerName(CONTAINER); return entityContainerInfo; } return null; }
Example #14
Source File: DemoEdmProvider.java From olingo-odata4 with Apache License 2.0 | 5 votes |
@Override public CsdlEntityContainerInfo getEntityContainerInfo(FullQualifiedName entityContainerName) { // This method is invoked when displaying the service document at // e.g. http://localhost:8080/DemoService/DemoService.svc if (entityContainerName == null || entityContainerName.equals(CONTAINER)) { CsdlEntityContainerInfo entityContainerInfo = new CsdlEntityContainerInfo(); entityContainerInfo.setContainerName(CONTAINER); return entityContainerInfo; } return null; }
Example #15
Source File: DemoEdmProvider.java From olingo-odata4 with Apache License 2.0 | 5 votes |
@Override public CsdlEntityContainerInfo getEntityContainerInfo(FullQualifiedName entityContainerName) { // This method is invoked when displaying the service document at // e.g. http://localhost:8080/DemoService/DemoService.svc if (entityContainerName == null || entityContainerName.equals(CONTAINER)) { CsdlEntityContainerInfo entityContainerInfo = new CsdlEntityContainerInfo(); entityContainerInfo.setContainerName(CONTAINER); return entityContainerInfo; } return null; }
Example #16
Source File: DemoEdmProvider.java From olingo-odata4 with Apache License 2.0 | 5 votes |
@Override public CsdlEntityContainerInfo getEntityContainerInfo(FullQualifiedName entityContainerName) { // This method is invoked when displaying the service document at // e.g. http://localhost:8080/DemoService/DemoService.svc if (entityContainerName == null || entityContainerName.equals(CONTAINER)) { CsdlEntityContainerInfo entityContainerInfo = new CsdlEntityContainerInfo(); entityContainerInfo.setContainerName(CONTAINER); return entityContainerInfo; } return null; }
Example #17
Source File: DemoEdmProvider.java From olingo-odata4 with Apache License 2.0 | 5 votes |
@Override public CsdlEntityContainerInfo getEntityContainerInfo(FullQualifiedName entityContainerName) { // This method is invoked when displaying the service document at // e.g. http://localhost:8080/DemoService/DemoService.svc if (entityContainerName == null || entityContainerName.equals(CONTAINER)) { CsdlEntityContainerInfo entityContainerInfo = new CsdlEntityContainerInfo(); entityContainerInfo.setContainerName(CONTAINER); return entityContainerInfo; } return null; }
Example #18
Source File: CarsEdmProvider.java From olingo-odata4 with Apache License 2.0 | 5 votes |
@Override public CsdlEntityContainerInfo getEntityContainerInfo(final FullQualifiedName entityContainerName) throws ODataException { if (entityContainerName == null || CONTAINER_FQN.equals(entityContainerName)) { return new CsdlEntityContainerInfo().setContainerName(CONTAINER_FQN); } return null; }
Example #19
Source File: DemoEdmProvider.java From cxf with Apache License 2.0 | 5 votes |
@Override public CsdlEntityContainerInfo getEntityContainerInfo(FullQualifiedName entityContainerName) { // This method is invoked when displaying the service document at // e.g. http://localhost:8080/DemoService/DemoService.svc if (entityContainerName == null || entityContainerName.equals(CONTAINER)) { CsdlEntityContainerInfo entityContainerInfo = new CsdlEntityContainerInfo(); entityContainerInfo.setContainerName(CONTAINER); return entityContainerInfo; } return null; }
Example #20
Source File: EdmProviderImplTest.java From olingo-odata4 with Apache License 2.0 | 5 votes |
@Before public void setup() throws Exception { CsdlEdmProvider provider = mock(CsdlEdmProvider.class); CsdlEntityContainerInfo containerInfo = new CsdlEntityContainerInfo().setContainerName(FQN); when(provider.getEntityContainerInfo(FQN)).thenReturn(containerInfo); when(provider.getEntityContainerInfo(null)).thenReturn(containerInfo); CsdlEnumType enumType = new CsdlEnumType().setName(FQN.getName()); when(provider.getEnumType(FQN)).thenReturn(enumType); CsdlTypeDefinition typeDefinition = new CsdlTypeDefinition().setName(FQN.getName()).setUnderlyingType(new FullQualifiedName("Edm", "String")); when(provider.getTypeDefinition(FQN)).thenReturn(typeDefinition); CsdlEntityType entityType = new CsdlEntityType().setName(FQN.getName()).setKey(new ArrayList<CsdlPropertyRef>()); when(provider.getEntityType(FQN)).thenReturn(entityType); CsdlComplexType complexType = new CsdlComplexType().setName(FQN.getName()); when(provider.getComplexType(FQN)).thenReturn(complexType); List<CsdlAliasInfo> aliasInfos = new ArrayList<CsdlAliasInfo>(); aliasInfos.add(new CsdlAliasInfo().setAlias("alias").setNamespace("namespace")); when(provider.getAliasInfos()).thenReturn(aliasInfos); CsdlAnnotations annotationsGroup = new CsdlAnnotations(); annotationsGroup.setTarget("FQN.FQN"); when(provider.getAnnotationsGroup(FQN, null)).thenReturn(annotationsGroup); edm = new EdmProviderImpl(provider); }
Example #21
Source File: EDMProvider.java From micro-integrator with Apache License 2.0 | 5 votes |
@Override public CsdlEntityContainerInfo getEntityContainerInfo(final FullQualifiedName entityContainerName) { if (entityContainerName == null || containerFullQName.equals(entityContainerName)) { return csdlEntityContainerInfo; } return null; }
Example #22
Source File: ProductsEdmProvider.java From syndesis with Apache License 2.0 | 5 votes |
@Override public CsdlEntityContainerInfo getEntityContainerInfo(FullQualifiedName entityContainerName) { // This method is invoked when displaying the Service Document at e.g. http://localhost:8080/DemoService/DemoService.svc if (entityContainerName == null || entityContainerName.equals(CONTAINER)) { CsdlEntityContainerInfo entityContainerInfo = new CsdlEntityContainerInfo(); entityContainerInfo.setContainerName(CONTAINER); return entityContainerInfo; } return null; }
Example #23
Source File: ObservationCsdlEdmProvider.java From arctic-sea with Apache License 2.0 | 5 votes |
@Override public CsdlEntityContainerInfo getEntityContainerInfo(FullQualifiedName name) throws ODataException { if (name == null || name.equals(FQN.CONTAINER)) { return newEntityContainerInfo(FQN.CONTAINER); } return super.getEntityContainerInfo(name); }
Example #24
Source File: ContainerProvider.java From olingo-odata4 with Apache License 2.0 | 5 votes |
public CsdlEntityContainerInfo getEntityContainerInfo(final FullQualifiedName entityContainerName) throws ODataException { if (entityContainerName == null || entityContainerName.equals(nameContainer)) { return new CsdlEntityContainerInfo().setContainerName(nameContainer); } return null; }
Example #25
Source File: EdmProviderImpl.java From olingo-odata4 with Apache License 2.0 | 5 votes |
@Override public EdmEntityContainer createEntityContainer(final FullQualifiedName containerName) { try { CsdlEntityContainerInfo entityContainerInfo = provider.getEntityContainerInfo(containerName); if (entityContainerInfo != null) { CsdlEntityContainer entityContainer = provider.getEntityContainer(); addEntityContainerAnnotations(entityContainer, entityContainerInfo.getContainerName()); return new EdmEntityContainerImpl(this, provider, entityContainerInfo.getContainerName(), entityContainer); } return null; } catch (ODataException e) { throw new EdmException(e); } }
Example #26
Source File: EdmEntityContainerImpl.java From olingo-odata4 with Apache License 2.0 | 5 votes |
public EdmEntityContainerImpl(final Edm edm, final CsdlEdmProvider provider, final CsdlEntityContainerInfo entityContainerInfo) { super(edm, entityContainerInfo.getContainerName().getName(), null); this.provider = provider; entityContainerName = entityContainerInfo.getContainerName(); parentContainerName = entityContainerInfo.getExtendsContainer(); }
Example #27
Source File: DemoEdmProvider.java From olingo-odata4 with Apache License 2.0 | 5 votes |
@Override public CsdlEntityContainerInfo getEntityContainerInfo(FullQualifiedName entityContainerName) { // This method is invoked when displaying the service document // at e.g. http://localhost:8080/DemoService/DemoService.svc if(entityContainerName == null || entityContainerName.equals(CONTAINER)){ CsdlEntityContainerInfo entityContainerInfo = new CsdlEntityContainerInfo(); entityContainerInfo.setContainerName(CONTAINER); return entityContainerInfo; } return null; }
Example #28
Source File: EdmEntitySetImplTest.java From olingo-odata4 with Apache License 2.0 | 5 votes |
@Test public void entitySetIncludeInServiceDocumentFalseAndInvalidType() throws Exception { CsdlEdmProvider provider = mock(CsdlEdmProvider.class); EdmProviderImpl edm = new EdmProviderImpl(provider); final FullQualifiedName containerName = new FullQualifiedName("ns", "container"); final CsdlEntityContainerInfo containerInfo = new CsdlEntityContainerInfo().setContainerName(containerName); when(provider.getEntityContainerInfo(containerName)).thenReturn(containerInfo); final EdmEntityContainer entityContainer = new EdmEntityContainerImpl(edm, provider, containerInfo); final String entitySetName = "entitySet"; final CsdlEntitySet entitySetProvider = new CsdlEntitySet() .setName(entitySetName) .setType("invalid.invalid") .setIncludeInServiceDocument(false); when(provider.getEntitySet(containerName, entitySetName)).thenReturn(entitySetProvider); final EdmEntitySet entitySet = new EdmEntitySetImpl(edm, entityContainer, entitySetProvider); assertFalse(entitySet.isIncludeInServiceDocument()); try { entitySet.getEntityType(); fail("Expected an EdmException"); } catch (EdmException e) { assertEquals("CanĀ“t find entity type: invalid.invalid for entity set or singleton: " + entitySetName, e .getMessage()); } }
Example #29
Source File: EdmEntityContainerImplTest.java From olingo-odata4 with Apache License 2.0 | 5 votes |
@Before public void setup() { CsdlEdmProvider provider = new CustomProvider(); EdmProviderImpl edm = new EdmProviderImpl(provider); CsdlEntityContainerInfo entityContainerInfo = new CsdlEntityContainerInfo().setContainerName(new FullQualifiedName("space", "name")); container = new EdmEntityContainerImpl(edm, provider, entityContainerInfo); }
Example #30
Source File: MetadataDocumentJsonSerializerTest.java From olingo-odata4 with Apache License 2.0 | 5 votes |
@Override public CsdlEntityContainerInfo getEntityContainerInfo(final FullQualifiedName entityContainerName) throws ODataException { if (entityContainerName == null) { return new CsdlEntityContainerInfo().setContainerName(new FullQualifiedName("org.olingo", "container")); } return null; }