本文整理汇总了Java中org.apache.olingo.commons.api.edm.provider.CsdlEntitySet类的典型用法代码示例。如果您正苦于以下问题:Java CsdlEntitySet类的具体用法?Java CsdlEntitySet怎么用?Java CsdlEntitySet使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CsdlEntitySet类属于org.apache.olingo.commons.api.edm.provider包,在下文中一共展示了CsdlEntitySet类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: test_JpaEntityCsdlProvider_getCsdlEntitySet_returnsWhatDefined
import org.apache.olingo.commons.api.edm.provider.CsdlEntitySet; //导入依赖的package包/类
@Test
public void test_JpaEntityCsdlProvider_getCsdlEntitySet_returnsWhatDefined() throws CsdlExtractException {
// GIVEN
final JpaEntityCsdlProvider sut = new TestCsdlEntityProvider();
// WHEN
CsdlEntitySet result = sut.getCsdlEntitySet();
List<CsdlNavigationPropertyBinding> bindings = result.getNavigationPropertyBindings();
// THEN
assertThat(result.getName()).isEqualTo(SET_1);
assertThat(result.getTypeFQN().getNamespace()).isEqualTo(FullQualifiedNamesUtil.NAMESPACE.ENTITIES);
assertThat(bindings).hasSize(2);
assertThat(bindings.get(0).getTarget()).isEqualTo(SET_2);
assertThat(bindings.get(0).getPath()).isEqualTo(NESTED_FIELD);
assertThat(bindings.get(1).getPath()).isEqualTo(SET_2);
}
开发者ID:mat3e,项目名称:olingo-jpa,代码行数:19,代码来源:JpaEntityCsdlProviderTest.java
示例2: getEntitySet
import org.apache.olingo.commons.api.edm.provider.CsdlEntitySet; //导入依赖的package包/类
@Override
public CsdlEntitySet getEntitySet(FullQualifiedName entityContainer, final String name) throws ODataException {
try {
//for (CsdlSchema schema : this.rdfEdmModelProvider.getEdmMetadata().getSchemas()) {
CsdlEntityContainer schemaEntityContainer = this.rdfEdmModelProvider.getEdmMetadata().getSchema(entityContainer.getNamespace()).getEntityContainer();
//if (entityContainer.equals(schemaEntityContainer.getName())) {
for (CsdlEntitySet entitySet : schemaEntityContainer.getEntitySets()) {
if (name.equals(entitySet.getName())) {
return entitySet;
}
}
//}
// }
} catch (NullPointerException e) {
log.error("NullPointerException getEntitySet " + entityContainer + " " + name);
throw new ODataException("NullPointerException getEntitySet " + entityContainer + " " + name);
}
return null;
}
开发者ID:peterjohnlawrence,项目名称:com.inova8.odata2sparql.v4,代码行数:22,代码来源:RdfEdmProvider.java
示例3: getEntityContainer
import org.apache.olingo.commons.api.edm.provider.CsdlEntitySet; //导入依赖的package包/类
@Override
public CsdlEntityContainer getEntityContainer() throws ODataException {
// create EntityContainer
CsdlEntityContainer entityContainer = new CsdlEntityContainer();
entityContainer.setName(getContainerName().getName());
List<CsdlSchema> schemas = getSchemas();
for (CsdlSchema schema : schemas) {
for (CsdlEntitySet entitySet : schema.getEntityContainer().getEntitySets()) {
if (entitySet.isIncludeInServiceDocument()) {
entityContainer.getEntitySets().add(entitySet);
}
}
}
return entityContainer;
}
开发者ID:Hevelian,项目名称:hevelian-olastic,代码行数:17,代码来源:ElasticCsdlEdmProvider.java
示例4: getEntityContainer_ContainerWithEntitySetsRetrieved
import org.apache.olingo.commons.api.edm.provider.CsdlEntitySet; //导入依赖的package包/类
@Test
public void getEntityContainer_ContainerWithEntitySetsRetrieved() throws ODataException {
MultyElasticIndexCsdlEdmProvider edmProvider = spy(
new MultyElasticIndexCsdlEdmProvider(metaDataProvider, indices));
List<CsdlSchema> schemas = new ArrayList<>();
CsdlSchema schema1 = mock(CsdlSchema.class);
CsdlEntityContainer container = mock(CsdlEntityContainer.class);
List<CsdlEntitySet> entitySets = new ArrayList<>();
CsdlEntitySet set1 = mock(CsdlEntitySet.class);
when(set1.isIncludeInServiceDocument()).thenReturn(true);
entitySets.add(set1);
entitySets.add(mock(CsdlEntitySet.class));
when(container.getEntitySets()).thenReturn(entitySets);
when(schema1.getEntityContainer()).thenReturn(container);
schemas.add(schema1);
CsdlSchema schema2 = mock(CsdlSchema.class);
when(schema2.getEntityContainer()).thenReturn(mock(CsdlEntityContainer.class));
schemas.add(schema2);
doReturn(schemas).when(edmProvider).getSchemas();
CsdlEntityContainer entityContainer = edmProvider.getEntityContainer();
assertEquals(edmProvider.getContainerName().getName(), entityContainer.getName());
assertEquals(1, entityContainer.getEntitySets().size());
}
开发者ID:Hevelian,项目名称:hevelian-olastic,代码行数:24,代码来源:MultyElasticIndexCsdlEdmProviderTest.java
示例5: getEntityContainer
import org.apache.olingo.commons.api.edm.provider.CsdlEntitySet; //导入依赖的package包/类
@Override
public CsdlEntityContainer getEntityContainer() throws ODataException {
CsdlEntityContainer container = new CsdlEntityContainer();
List<CsdlEntitySet> entitySets = new ArrayList<CsdlEntitySet>();
entitySets.add(new CsdlEntitySet().setName("entitySetName"));
entitySets.add(new CsdlEntitySet().setName("entitySetName2"));
container.setEntitySets(entitySets);
List<CsdlSingleton> singletons = new ArrayList<CsdlSingleton>();
singletons.add(new CsdlSingleton().setName("singletonName"));
singletons.add(new CsdlSingleton().setName("singletonName2"));
container.setSingletons(singletons);
List<CsdlActionImport> actionImports = new ArrayList<CsdlActionImport>();
actionImports.add(new CsdlActionImport().setName("actionImportName"));
actionImports.add(new CsdlActionImport().setName("actionImportName2"));
container.setActionImports(actionImports);
List<CsdlFunctionImport> functionImports = new ArrayList<CsdlFunctionImport>();
functionImports.add(new CsdlFunctionImport().setName("functionImportName"));
functionImports.add(new CsdlFunctionImport().setName("functionImportName2"));
container.setFunctionImports(functionImports);
return container;
}
开发者ID:apache,项目名称:olingo-odata4,代码行数:26,代码来源:EdmEntityContainerImplTest.java
示例6: initialMappingMustBeNull
import org.apache.olingo.commons.api.edm.provider.CsdlEntitySet; //导入依赖的package包/类
@Test
public void initialMappingMustBeNull() {
CsdlProperty property = new CsdlProperty().setType(EdmPrimitiveTypeKind.DateTimeOffset.getFullQualifiedName());
EdmProperty edmProperty = new EdmPropertyImpl(null, property);
assertNull(edmProperty.getMapping());
CsdlParameter parameter = new CsdlParameter().setType(EdmPrimitiveTypeKind.DateTimeOffset.getFullQualifiedName());
EdmParameter edmParameter = new EdmParameterImpl(null, parameter);
assertNull(edmParameter.getMapping());
CsdlEntitySet es = new CsdlEntitySet().setName("test");
EdmEntitySet edmES = new EdmEntitySetImpl(null, null, es);
assertNull(edmES.getMapping());
CsdlSingleton si = new CsdlSingleton().setName("test");
EdmSingleton edmSi = new EdmSingletonImpl(null, null, si);
assertNull(edmSi.getMapping());
}
开发者ID:apache,项目名称:olingo-odata4,代码行数:19,代码来源:EdmMappingTest.java
示例7: getInternalNameViaMapping
import org.apache.olingo.commons.api.edm.provider.CsdlEntitySet; //导入依赖的package包/类
public void getInternalNameViaMapping() {
CsdlMapping mapping = new CsdlMapping().setInternalName("internalName");
CsdlProperty property =
new CsdlProperty().setType(EdmPrimitiveTypeKind.DateTimeOffset.getFullQualifiedName()).setMapping(mapping);
EdmProperty edmProperty = new EdmPropertyImpl(null, property);
assertNotNull(edmProperty.getMapping());
assertEquals("internalName", edmProperty.getMapping().getInternalName());
CsdlParameter parameter =
new CsdlParameter().setType(EdmPrimitiveTypeKind.DateTimeOffset.getFullQualifiedName()).setMapping(mapping);
EdmParameter edmParameter = new EdmParameterImpl(null, parameter);
assertNotNull(edmParameter.getMapping());
assertEquals("internalName", edmParameter.getMapping().getInternalName());
CsdlEntitySet es = new CsdlEntitySet().setName("test").setMapping(mapping);
EdmEntitySet edmES = new EdmEntitySetImpl(null, null, es);
assertNotNull(edmES.getMapping());
assertEquals("internalName", edmES.getMapping().getInternalName());
CsdlSingleton si = new CsdlSingleton().setName("test").setMapping(mapping);
EdmSingleton edmSi = new EdmSingletonImpl(null, null, si);
assertNotNull(edmSi.getMapping());
assertEquals("internalName", edmSi.getMapping().getInternalName());
}
开发者ID:apache,项目名称:olingo-odata4,代码行数:26,代码来源:EdmMappingTest.java
示例8: uriParserExceptionResultsInRightResponseEdmCause
import org.apache.olingo.commons.api.edm.provider.CsdlEntitySet; //导入依赖的package包/类
@Test
public void uriParserExceptionResultsInRightResponseEdmCause() throws Exception {
final OData odata = OData.newInstance();
final ServiceMetadata serviceMetadata = odata.createServiceMetadata(
new CsdlAbstractEdmProvider() {
@Override
public CsdlEntitySet getEntitySet(final FullQualifiedName entityContainer, final String entitySetName)
throws ODataException {
throw new ODataException("msg");
}
},
Collections.<EdmxReference> emptyList());
ODataRequest request = new ODataRequest();
request.setMethod(HttpMethod.GET);
request.setRawODataPath("EdmException");
final ODataResponse response =
new ODataHandlerImpl(odata, serviceMetadata, new ServerCoreDebugger(odata)).process(request);
assertNotNull(response);
assertEquals(HttpStatusCode.INTERNAL_SERVER_ERROR.getStatusCode(), response.getStatusCode());
}
开发者ID:apache,项目名称:olingo-odata4,代码行数:23,代码来源:ODataHandlerImplTest.java
示例9: findLastQualifiedTargetName
import org.apache.olingo.commons.api.edm.provider.CsdlEntitySet; //导入依赖的package包/类
/**
* This looks for the correct entity set
* when the target entity set is part of some other namespace
* e.g <NavigationPropertyBinding Path="Products" Target="SomeModel.SomeContainer/SomeSet" />
* @param navBindingTarget
* @return String
*/
private String findLastQualifiedTargetName(String navBindingTarget) {
String[] targetPaths = navBindingTarget.split("/");
CsdlEntityContainer csdlContainer = csdlContainersMap.containsKey(new FullQualifiedName(targetPaths[0])) ?
csdlContainersMap.get(new FullQualifiedName(targetPaths[0])) :
csdlContainersMap.get(fetchCorrectNamespaceFromAlias(new FullQualifiedName(targetPaths[0])));
if (csdlContainer == null) {
throw new RuntimeException("Container with FullyQualifiedName " + targetPaths[0] + " not found.");
}
String targetEntitySetName = targetPaths[1];
CsdlEntitySet csdlEntitySet = csdlContainer.getEntitySet(targetEntitySetName);
if (csdlEntitySet == null) {
throw new RuntimeException("Target Entity Set mentioned in navigationBindingProperty "
+ "not found in the container " + csdlContainer.getName());
}
FullQualifiedName fqName = csdlEntitySet.getTypeFQN();
if (!(csdlEntityTypesMap.containsKey(fqName))) {
fqName = validateCsdlEntityTypeWithAlias(fqName);
}
return fqName.getFullQualifiedNameAsString();
}
开发者ID:apache,项目名称:olingo-odata4,代码行数:28,代码来源:CsdlTypeValidator.java
示例10: getEntityContainer
import org.apache.olingo.commons.api.edm.provider.CsdlEntitySet; //导入依赖的package包/类
@Override
public CsdlEntityContainer getEntityContainer() {
// create EntitySets
List<CsdlEntitySet> entitySets = new ArrayList<CsdlEntitySet>();
entitySets.add(getEntitySet(CONTAINER, ES_PRODUCTS_NAME));
entitySets.add(getEntitySet(CONTAINER, ES_CATEGORIES_NAME));
entitySets.add(getEntitySet(CONTAINER, ES_ADVERTISEMENTS_NAME));
// Create function imports
List<CsdlFunctionImport> functionImports = new ArrayList<CsdlFunctionImport>();
functionImports.add(getFunctionImport(CONTAINER, FUNCTION_COUNT_CATEGORIES));
// Create action imports
List<CsdlActionImport> actionImports = new ArrayList<CsdlActionImport>();
actionImports.add(getActionImport(CONTAINER, ACTION_RESET));
// create EntityContainer
CsdlEntityContainer entityContainer = new CsdlEntityContainer();
entityContainer.setName(CONTAINER_NAME);
entityContainer.setActionImports(actionImports);
entityContainer.setFunctionImports(functionImports);
entityContainer.setEntitySets(entitySets);
return entityContainer;
}
开发者ID:apache,项目名称:olingo-odata4,代码行数:27,代码来源:DemoEdmProvider.java
示例11: getEntityContainer
import org.apache.olingo.commons.api.edm.provider.CsdlEntitySet; //导入依赖的package包/类
public CsdlEntityContainer getEntityContainer() {
// create EntitySets
List<CsdlEntitySet> entitySets = new ArrayList<CsdlEntitySet>();
entitySets.add(getEntitySet(CONTAINER, ES_PRODUCTS_NAME));
entitySets.add(getEntitySet(CONTAINER, ES_CATEGORIES_NAME));
// Create function imports
List<CsdlFunctionImport> functionImports = new ArrayList<CsdlFunctionImport>();
functionImports.add(getFunctionImport(CONTAINER, FUNCTION_COUNT_CATEGORIES));
// Create action imports
List<CsdlActionImport> actionImports = new ArrayList<CsdlActionImport>();
actionImports.add(getActionImport(CONTAINER, ACTION_RESET));
// create EntityContainer
CsdlEntityContainer entityContainer = new CsdlEntityContainer();
entityContainer.setName(CONTAINER_NAME);
entityContainer.setEntitySets(entitySets);
entityContainer.setFunctionImports(functionImports);
entityContainer.setActionImports(actionImports);
return entityContainer;
}
开发者ID:apache,项目名称:olingo-odata4,代码行数:25,代码来源:DemoEdmProvider.java
示例12: getEntitySet
import org.apache.olingo.commons.api.edm.provider.CsdlEntitySet; //导入依赖的package包/类
@Override
public CsdlEntitySet getEntitySet(FullQualifiedName entityContainer, String entitySetName) {
if(entityContainer.equals(CONTAINER)){
if(entitySetName.equals(ES_PRODUCTS_NAME)){
CsdlEntitySet entitySet = new CsdlEntitySet();
entitySet.setName(ES_PRODUCTS_NAME);
entitySet.setType(ET_PRODUCT_FQN);
return entitySet;
}
}
return null;
}
开发者ID:apache,项目名称:olingo-odata4,代码行数:17,代码来源:DemoEdmProvider.java
示例13: getEntitySet
import org.apache.olingo.commons.api.edm.provider.CsdlEntitySet; //导入依赖的package包/类
@Override
public CsdlEntitySet getEntitySet(final FullQualifiedName entityContainer, final String entitySetName)
throws ODataException {
if (CONTAINER_FQN.equals(entityContainer)) {
if (ES_CARS_NAME.equals(entitySetName)) {
return new CsdlEntitySet()
.setName(ES_CARS_NAME)
.setType(ET_CAR)
.setNavigationPropertyBindings(
Arrays.asList(
new CsdlNavigationPropertyBinding().setPath("Manufacturer").setTarget(
CONTAINER_FQN.getFullQualifiedNameAsString() + "/" + ES_MANUFACTURER_NAME)));
} else if (ES_MANUFACTURER_NAME.equals(entitySetName)) {
return new CsdlEntitySet()
.setName(ES_MANUFACTURER_NAME)
.setType(ET_MANUFACTURER).setNavigationPropertyBindings(
Arrays.asList(
new CsdlNavigationPropertyBinding().setPath("Cars")
.setTarget(CONTAINER_FQN.getFullQualifiedNameAsString() + "/" + ES_CARS_NAME)));
}
}
return null;
}
开发者ID:apache,项目名称:olingo-odata4,代码行数:25,代码来源:CarsEdmProvider.java
示例14: AbstractEdmProvider
import org.apache.olingo.commons.api.edm.provider.CsdlEntitySet; //导入依赖的package包/类
public AbstractEdmProvider(List<CsdlProvider> providers) {
// Set is always in the context of container.
List<CsdlEntitySet> entitySets = new ArrayList<>();
providers.forEach(csdlProvider -> {
CsdlEntitySet set = csdlProvider.getCsdlEntitySet();
if (set != null) {
entitySets.add(set);
}
updateTypesMapWithType(csdlProvider.getCsdlEntityType(), entities);
updateTypesMapWithType(csdlProvider.getCsdlEnumType(), enums);
updateTypesMapWithType(csdlProvider.getCsdlComplexType(), complexTypes);
updateOperationsMapFromList(csdlProvider.getCsdlActions(), actions);
updateOperationsMapFromList(csdlProvider.getCsdlFunctions(), functions);
});
container.setEntitySets(entitySets).setActionImports(getActionImports())
.setFunctionImports(getFunctionImports());
schemas.add(
new CsdlSchema().setNamespace(FullQualifiedNamesUtil.NAMESPACE.ENTITIES).setEntityContainer(container)
.setEntityTypes(new ArrayList<>(entities.values())));
schemas.add(new CsdlSchema().setNamespace(FullQualifiedNamesUtil.NAMESPACE.ACTIONS)
.setActions(normalizeOperations(actions)));
schemas.add(new CsdlSchema().setNamespace(FullQualifiedNamesUtil.NAMESPACE.FUNCTIONS)
.setFunctions(normalizeOperations(functions)));
schemas.add(new CsdlSchema().setNamespace(FullQualifiedNamesUtil.NAMESPACE.ENUMS)
.setEnumTypes(new ArrayList<>(enums.values())));
schemas.add(new CsdlSchema().setNamespace(FullQualifiedNamesUtil.NAMESPACE.COMPLEX_TYPES)
.setComplexTypes(new ArrayList<>(complexTypes.values())));
}
开发者ID:mat3e,项目名称:olingo-jpa,代码行数:36,代码来源:AbstractEdmProvider.java
示例15: getEntitySet
import org.apache.olingo.commons.api.edm.provider.CsdlEntitySet; //导入依赖的package包/类
@Override
public CsdlEntitySet getEntitySet(FullQualifiedName entityContainer, String entitySetName) {
if (entityContainer.equals(FullQualifiedNamesUtil.CONTAINER_FQN)) {
return container.getEntitySet(entitySetName);
}
return null;
}
开发者ID:mat3e,项目名称:olingo-jpa,代码行数:8,代码来源:AbstractEdmProvider.java
示例16: toEntitySet
import org.apache.olingo.commons.api.edm.provider.CsdlEntitySet; //导入依赖的package包/类
private CsdlEntitySet toEntitySet(MappingMetaData mappingMetaData) {
CsdlEntityType entityType = toEntityType(mappingMetaData);
FullQualifiedName entityTypeFqn = new FullQualifiedName(
schema.getNamespace(), entityType.getName());
nameToEntityTypeMap.put(entityTypeFqn, entityType);
return new CsdlEntitySet()
.setName(entityType.getName())
.setType(entityTypeFqn);
}
开发者ID:pukkaone,项目名称:odata-spring-boot-starter,代码行数:12,代码来源:IndexToCsdlSchemaMapper.java
示例17: setName
import org.apache.olingo.commons.api.edm.provider.CsdlEntitySet; //导入依赖的package包/类
@Override
public CsdlEntitySet setName(String name) {
if (esType == null) {
setESType(name);
}
return super.setName(name);
}
开发者ID:Hevelian,项目名称:hevelian-olastic,代码行数:8,代码来源:ElasticCsdlEntitySet.java
示例18: getEntitySet
import org.apache.olingo.commons.api.edm.provider.CsdlEntitySet; //导入依赖的package包/类
@Override
public CsdlEntitySet getEntitySet() {
CsdlEntitySet entitySet = new CsdlEntitySet();
entitySet.setName(entitySetName);
entitySet.setType(getFqdName());
entitySet.setIncludeInServiceDocument(true);
return entitySet;
}
开发者ID:RedHelixOrg,项目名称:RedHelix-1,代码行数:11,代码来源:RedHxAbstractEdmEntityProvider.java
示例19: createEntitySet
import org.apache.olingo.commons.api.edm.provider.CsdlEntitySet; //导入依赖的package包/类
protected EdmEntitySet createEntitySet(final String entitySetName) {
EdmEntitySet entitySet = null;
try {
final CsdlEntitySet providerEntitySet = provider.getEntitySet(entityContainerName, entitySetName);
if (providerEntitySet != null) {
entitySet = new EdmEntitySetImpl(edm, this, providerEntitySet);
}
} catch (ODataException e) {
throw new EdmException(e);
}
return entitySet;
}
开发者ID:apache,项目名称:olingo-odata4,代码行数:15,代码来源:EdmEntityContainerImpl.java
示例20: loadAllEntitySets
import org.apache.olingo.commons.api.edm.provider.CsdlEntitySet; //导入依赖的package包/类
protected void loadAllEntitySets() {
loadContainer();
final List<CsdlEntitySet> providerEntitySets = container.getEntitySets();
final List<EdmEntitySet> entitySetsLocal = new ArrayList<EdmEntitySet>();
if (providerEntitySets != null) {
for (CsdlEntitySet entitySet : providerEntitySets) {
final EdmEntitySetImpl impl = new EdmEntitySetImpl(edm, this, entitySet);
entitySetCache.put(impl.getName(), impl);
entitySetsLocal.add(impl);
}
entitySets = entitySetsLocal;
}
}
开发者ID:apache,项目名称:olingo-odata4,代码行数:15,代码来源:EdmEntityContainerImpl.java
注:本文中的org.apache.olingo.commons.api.edm.provider.CsdlEntitySet类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论