当前位置: 首页>>代码示例>>Java>>正文


Java CsdlEntityContainerInfo类代码示例

本文整理汇总了Java中org.apache.olingo.commons.api.edm.provider.CsdlEntityContainerInfo的典型用法代码示例。如果您正苦于以下问题:Java CsdlEntityContainerInfo类的具体用法?Java CsdlEntityContainerInfo怎么用?Java CsdlEntityContainerInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


CsdlEntityContainerInfo类属于org.apache.olingo.commons.api.edm.provider包,在下文中一共展示了CsdlEntityContainerInfo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getEntityContainerInfo

import org.apache.olingo.commons.api.edm.provider.CsdlEntityContainerInfo; //导入依赖的package包/类
@Override
public CsdlEntityContainerInfo getEntityContainerInfo(FullQualifiedName entityContainer) throws ODataException {
	if (entityContainer == null) {
		// Assume request for null container means default container
		return new CsdlEntityContainerInfo().setContainerName(new FullQualifiedName(RdfConstants.ENTITYCONTAINERNAMESPACE,RdfConstants.ENTITYCONTAINER));
	} else {
		try {
			for (CsdlSchema schema : this.rdfEdmModelProvider.getEdmMetadata().getSchemas()) {
				CsdlEntityContainer schemaEntityContainer = schema.getEntityContainer();
				if (entityContainer.equals(schemaEntityContainer.getName())) {
					return new CsdlEntityContainerInfo().setContainerName(entityContainer);
				}
			}
		} catch (NullPointerException e) {
			log.error("NullPointerException getEntityContainerInfo " + entityContainer);
			throw new ODataException("NullPointerException getEntityContainerInfo " + entityContainer);
		}
	}
	return null;
}
 
开发者ID:peterjohnlawrence,项目名称:com.inova8.odata2sparql.v4,代码行数:21,代码来源:RdfEdmProvider.java

示例2: getEntityContainerInfo

import org.apache.olingo.commons.api.edm.provider.CsdlEntityContainerInfo; //导入依赖的package包/类
@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;
}
 
开发者ID:apache,项目名称:olingo-odata4,代码行数:18,代码来源:CrossServiceTest.java

示例3: wrongTarget

import org.apache.olingo.commons.api.edm.provider.CsdlEntityContainerInfo; //导入依赖的package包/类
@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");
}
 
开发者ID:apache,项目名称:olingo-odata4,代码行数:20,代码来源:EdmSingletonImplTest.java

示例4: createEntityContainer

import org.apache.olingo.commons.api.edm.provider.CsdlEntityContainerInfo; //导入依赖的package包/类
@Override
public EdmEntityContainer createEntityContainer(FullQualifiedName containerName) {
    CsdlEntityContainerInfo entityContainerInfo = csdlProvider
            .getEntityContainerInfo(containerName);
    if (entityContainerInfo != null) {
        return new ElasticEdmEntityContainer(this, csdlProvider, entityContainerInfo);
    }
    return null;
}
 
开发者ID:Hevelian,项目名称:hevelian-olastic,代码行数:10,代码来源:ElasticEdmProvider.java

示例5: getEntityContainerInfo_ContainerNameNull_EntityContainerRetieved

import org.apache.olingo.commons.api.edm.provider.CsdlEntityContainerInfo; //导入依赖的package包/类
@Test
public void getEntityContainerInfo_ContainerNameNull_EntityContainerRetieved() {
    MultyElasticIndexCsdlEdmProvider edmProvider = new MultyElasticIndexCsdlEdmProvider(
            metaDataProvider, indices);
    CsdlEntityContainerInfo entityContainerInfo = edmProvider.getEntityContainerInfo(null);
    assertNotNull(entityContainerInfo);
    assertEquals(edmProvider.getContainerName(), entityContainerInfo.getContainerName());
}
 
开发者ID:Hevelian,项目名称:hevelian-olastic,代码行数:9,代码来源:MultyElasticIndexCsdlEdmProviderTest.java

示例6: getEntityContainerInfo

import org.apache.olingo.commons.api.edm.provider.CsdlEntityContainerInfo; //导入依赖的package包/类
public CsdlEntityContainerInfo getEntityContainerInfo(final FullQualifiedName entityContainerName)
    throws ODataException {
  if (entityContainerName == null || entityContainerName.equals(nameContainer)) {
    return new CsdlEntityContainerInfo().setContainerName(nameContainer);
  }
  return null;
}
 
开发者ID:apache,项目名称:olingo-odata4,代码行数:8,代码来源:ContainerProvider.java

示例7: createEntityContainer

import org.apache.olingo.commons.api.edm.provider.CsdlEntityContainerInfo; //导入依赖的package包/类
@Override
public EdmEntityContainer createEntityContainer(final FullQualifiedName containerName) {
  try {
    CsdlEntityContainerInfo entityContainerInfo = provider.getEntityContainerInfo(containerName);
    if (entityContainerInfo != null) {
      return new EdmEntityContainerImpl(this, provider, entityContainerInfo);
    }
    return null;
  } catch (ODataException e) {
    throw new EdmException(e);
  }
}
 
开发者ID:apache,项目名称:olingo-odata4,代码行数:13,代码来源:EdmProviderImpl.java

示例8: EdmEntityContainerImpl

import org.apache.olingo.commons.api.edm.provider.CsdlEntityContainerInfo; //导入依赖的package包/类
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();
}
 
开发者ID:apache,项目名称:olingo-odata4,代码行数:8,代码来源:EdmEntityContainerImpl.java

示例9: setup

import org.apache.olingo.commons.api.edm.provider.CsdlEntityContainerInfo; //导入依赖的package包/类
@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);
}
 
开发者ID:apache,项目名称:olingo-odata4,代码行数:31,代码来源:EdmProviderImplTest.java

示例10: entitySetIncludeInServiceDocumentFalseAndInvalidType

import org.apache.olingo.commons.api.edm.provider.CsdlEntityContainerInfo; //导入依赖的package包/类
@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());
  }
}
 
开发者ID:apache,项目名称:olingo-odata4,代码行数:29,代码来源:EdmEntitySetImplTest.java

示例11: setup

import org.apache.olingo.commons.api.edm.provider.CsdlEntityContainerInfo; //导入依赖的package包/类
@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);
}
 
开发者ID:apache,项目名称:olingo-odata4,代码行数:9,代码来源:EdmEntityContainerImplTest.java

示例12: getEntityContainerInfo

import org.apache.olingo.commons.api.edm.provider.CsdlEntityContainerInfo; //导入依赖的package包/类
@Override
public CsdlEntityContainerInfo getEntityContainerInfo(final FullQualifiedName entityContainerName)
    throws ODataException {
  if (entityContainerName == null) {
    return new CsdlEntityContainerInfo().setContainerName(new FullQualifiedName("org.olingo", "container"));
  }
  return null;
}
 
开发者ID:apache,项目名称:olingo-odata4,代码行数:9,代码来源:MetadataDocumentJsonSerializerTest.java

示例13: getEntityContainerInfo

import org.apache.olingo.commons.api.edm.provider.CsdlEntityContainerInfo; //导入依赖的package包/类
@Override
public CsdlEntityContainerInfo getEntityContainerInfo(FullQualifiedName fqn) throws ODataException {
  CsdlSchema schema = null;

  if (fqn == null) {
    for (CsdlSchema s : this.edmSchemas) {
      if (s.getEntityContainer() != null) {
        schema = s;
        break;
      }
    }
  } else {
    schema = getSchema(fqn.getNamespace());
  }

  if (schema != null) {
    CsdlEntityContainer ec = schema.getEntityContainer();
    if (ec != null) {
      CsdlEntityContainerInfo info = new CsdlEntityContainerInfo();
      info.setContainerName(new FullQualifiedName(schema.getNamespace(), ec.getName()));
      if (schema.getEntityContainer().getExtendsContainer() != null) {
        info.setExtendsContainer(new FullQualifiedName(schema.getEntityContainer().getExtendsContainer()));
      }
      return info;
    }
  }
  return null;
}
 
开发者ID:apache,项目名称:olingo-odata4,代码行数:29,代码来源:SchemaBasedEdmProvider.java

示例14: getEntityContainerInfo

import org.apache.olingo.commons.api.edm.provider.CsdlEntityContainerInfo; //导入依赖的package包/类
@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;
}
 
开发者ID:apache,项目名称:olingo-odata4,代码行数:13,代码来源:DemoEdmProvider.java

示例15: getEntityContainerInfo

import org.apache.olingo.commons.api.edm.provider.CsdlEntityContainerInfo; //导入依赖的package包/类
@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;

}
 
开发者ID:apache,项目名称:olingo-odata4,代码行数:14,代码来源:DemoEdmProvider.java


注:本文中的org.apache.olingo.commons.api.edm.provider.CsdlEntityContainerInfo类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。