• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java EntityType类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: extendJPAEdmSchema

import org.apache.olingo.odata2.api.edm.provider.EntityType; //导入依赖的package包/类
@Override
public void extendJPAEdmSchema(JPAEdmSchemaView view) {
	ResourceBundle i18n = ODataContextUtil.getResourceBundle("i18n");
	final Schema edmSchema = view.getEdmSchema();
	
	for (EntityType entityType : edmSchema.getEntityTypes()) {
		for (Property property : entityType.getProperties()) {
			String label = null;
			if (i18n != null) { try { label = i18n.getString(entityType.getName() + "." + property.getName()); } catch (Exception e) {} }
			List<AnnotationAttribute> annotationAttributeList = new ArrayList<AnnotationAttribute>();
			if (label != null) {
				annotationAttributeList.add(new AnnotationAttribute()
						.setNamespace(SAP_NAMESPACE)
						.setPrefix(SAP_PREFIX)
						.setName(LABEL).setText(label));
			}
			annotationAttributeList.addAll(getSapPropertyAnnotations(entityType, property));
			property.setAnnotationAttributes(annotationAttributeList); 
		}
	}
	
	addSmartAnnotations(edmSchema);
}
 
开发者ID:jpenninkhof,项目名称:odata-boilerplate,代码行数:24,代码来源:JPAEdmExtension.java


示例2: buildEntityType

import org.apache.olingo.odata2.api.edm.provider.EntityType; //导入依赖的package包/类
public EntityType buildEntityType() {
  EntityType entityType = new EntityType();
  if (baseEntityType != null) {
    entityType.setBaseType(baseEntityType);
  }
  if (!keyProperties.isEmpty()) {
    entityType.setKey(new Key().setKeys(keyProperties));
  }
  if (!navProperties.isEmpty()) {
    entityType.setNavigationProperties(navProperties);
  }
  return entityType.setName(name)
      .setAbstract(isAbstract)
      .setHasStream(isMediaResource)
      .setProperties(properties)
      .setMapping(new Mapping().setMediaResourceMimeTypeKey(mediaResourceMimeTypeKey)
                                .setMediaResourceSourceKey(mediaResourceSourceKey));
}
 
开发者ID:apache,项目名称:olingo-odata2,代码行数:19,代码来源:AnnotationEdmProvider.java


示例3: loadAnnotatedClassesFromPackage

import org.apache.olingo.odata2.api.edm.provider.EntityType; //导入依赖的package包/类
@Test
public void loadAnnotatedClassesFromPackage() throws Exception {
  AnnotationEdmProvider localAep = new AnnotationEdmProvider(TEST_MODEL_PACKAGE);

  // validate employee
  EntityType employee = localAep.getEntityType(new FullQualifiedName(ModelSharedConstants.NAMESPACE_1, "Employee"));
  assertEquals("Employee", employee.getName());
  final List<PropertyRef> employeeKeys = employee.getKey().getKeys();
  assertEquals(1, employeeKeys.size());
  assertEquals("EmployeeId", employeeKeys.get(0).getName());
  assertEquals(6, employee.getProperties().size());
  assertEquals(3, employee.getNavigationProperties().size());

  List<Schema> schemas = localAep.getSchemas();
  assertEquals(1, schemas.size());
  EntityContainerInfo info = localAep.getEntityContainerInfo(ModelSharedConstants.CONTAINER_1);
  assertTrue(info.isDefaultEntityContainer());
}
 
开发者ID:apache,项目名称:olingo-odata2,代码行数:19,代码来源:AnnotationEdmProviderTest.java


示例4: entityTypeEmployee

import org.apache.olingo.odata2.api.edm.provider.EntityType; //导入依赖的package包/类
@Test
public void entityTypeEmployee() throws Exception {
  // validate employee
  EntityType employee = aep.getEntityType(new FullQualifiedName(ModelSharedConstants.NAMESPACE_1, "Employee"));
  assertEquals("Employee", employee.getName());
  final List<PropertyRef> employeeKeys = employee.getKey().getKeys();
  assertEquals(1, employeeKeys.size());
  assertEquals("EmployeeId", employeeKeys.get(0).getName());
  assertEquals(6, employee.getProperties().size());
  assertEquals(3, employee.getNavigationProperties().size());
  Property name = getProperty(employee, "EmployeeName");
  assertEquals(Integer.valueOf(20), name.getFacets().getMaxLength());

  for (NavigationProperty navigationProperty : employee.getNavigationProperties()) {
    if (navigationProperty.getName().equals("ne_Manager")) {
      validateNavProperty(navigationProperty, "ManagerEmployees", "r_Employees", "r_Manager");
    } else if (navigationProperty.getName().equals("ne_Team")) {
      validateNavProperty(navigationProperty, "TeamEmployees", "r_Employees", "r_Team");
    } else if (navigationProperty.getName().equals("ne_Room")) {
      validateNavProperty(navigationProperty, "r_Employees_2_r_Room", "r_Employees", "r_Room");
    } else {
      fail("Got unexpected navigation property with name '" + navigationProperty.getName() + "'.");
    }
  }
}
 
开发者ID:apache,项目名称:olingo-odata2,代码行数:26,代码来源:AnnotationEdmProviderTest.java


示例5: facetsTest

import org.apache.olingo.odata2.api.edm.provider.EntityType; //导入依赖的package包/类
@Test
public void facetsTest() throws Exception {
  EntityType employee = aep.getEntityType(new FullQualifiedName(ModelSharedConstants.NAMESPACE_1, "Employee"));
  assertEquals("Employee", employee.getName());
  Property name = getProperty(employee, "EmployeeName");
  assertEquals(Integer.valueOf(20), name.getFacets().getMaxLength());
  assertNull(name.getFacets().getConcurrencyMode());
  assertTrue(name.getFacets().isNullable());
  Property id = getProperty(employee, "EmployeeId");
  assertFalse(id.getFacets().isNullable());

  ComplexType city = aep.getComplexType(new FullQualifiedName(ModelSharedConstants.NAMESPACE_1, "c_City"));
  Property postalCode = getProperty(city.getProperties(), "PostalCode");
  assertEquals(Integer.valueOf(5), postalCode.getFacets().getMaxLength());

  EntityType room = aep.getEntityType(new FullQualifiedName(ModelSharedConstants.NAMESPACE_1, "Room"));
  Property version = getProperty(room, "Version");
  assertEquals(Integer.valueOf(0), version.getFacets().getScale());
  assertEquals(Integer.valueOf(0), version.getFacets().getPrecision());
  assertEquals(EdmConcurrencyMode.Fixed, version.getFacets().getConcurrencyMode());
}
 
开发者ID:apache,项目名称:olingo-odata2,代码行数:22,代码来源:AnnotationEdmProviderTest.java


示例6: entityTypeAbstractBaseType

import org.apache.olingo.odata2.api.edm.provider.EntityType; //导入依赖的package包/类
@Test
public void entityTypeAbstractBaseType() throws Exception {
  // validate employee
  EntityType baseType = aep.getEntityType(new FullQualifiedName(ModelSharedConstants.NAMESPACE_1, "Base"));
  assertEquals("Base", baseType.getName());
  final List<PropertyRef> keys = baseType.getKey().getKeys();
  assertEquals(1, keys.size());
  assertEquals("Id", keys.get(0).getName());
  assertEquals(2, baseType.getProperties().size());
  assertTrue(baseType.isAbstract());

  // validate base for team
  EntityType team = aep.getEntityType(new FullQualifiedName(ModelSharedConstants.NAMESPACE_1, "Team"));
  assertEquals("Team", team.getName());
  assertEquals("Base", team.getBaseType().getName());
  assertEquals(ModelSharedConstants.NAMESPACE_1, team.getBaseType().getNamespace());
}
 
开发者ID:apache,项目名称:olingo-odata2,代码行数:18,代码来源:AnnotationEdmProviderTest.java


示例7: complexTypeLocation

import org.apache.olingo.odata2.api.edm.provider.EntityType; //导入依赖的package包/类
@Test
public void complexTypeLocation() throws Exception {
  // validate employee
  EntityType employee = aep.getEntityType(new FullQualifiedName(ModelSharedConstants.NAMESPACE_1, "Employee"));
  final List<Property> properties = employee.getProperties();
  Property location = null;
  for (Property property : properties) {
    if (property.getName().equals("Location")) {
      location = property;
    }
  }
  assertNotNull(location);
  assertEquals("Location", location.getName());

  // validate location complex type
  ComplexType locationType = aep.getComplexType(
      new FullQualifiedName(ModelSharedConstants.NAMESPACE_1, "c_Location"));
  assertEquals("c_Location", locationType.getName());
  assertEquals(2, locationType.getProperties().size());
}
 
开发者ID:apache,项目名称:olingo-odata2,代码行数:21,代码来源:AnnotationEdmProviderTest.java


示例8: entityTypeRoomWithNavigation

import org.apache.olingo.odata2.api.edm.provider.EntityType; //导入依赖的package包/类
@Test
public void entityTypeRoomWithNavigation() throws Exception {
  // validate employee
  EntityType room = aep.getEntityType(new FullQualifiedName(ModelSharedConstants.NAMESPACE_1, "Room"));
  assertEquals("Room", room.getName());
  assertEquals("Base", room.getBaseType().getName());
  assertEquals(2, room.getProperties().size());
  final List<NavigationProperty> navigationProperties = room.getNavigationProperties();
  assertEquals(2, navigationProperties.size());

  for (NavigationProperty navigationProperty : navigationProperties) {
    if (navigationProperty.getName().equals("nr_Employees")) {
      validateNavProperty(navigationProperty, "r_Employees_2_r_Room", "r_Room", "r_Employees");
    } else if (navigationProperty.getName().equals("nr_Building")) {
      validateNavProperty(navigationProperty, "BuildingRooms", "r_Rooms", "r_Building");
    } else {
      fail("Got unexpected navigation property with name '" + navigationProperty.getName() + "'.");
    }
  }
}
 
开发者ID:apache,项目名称:olingo-odata2,代码行数:21,代码来源:AnnotationEdmProviderTest.java


示例9: build

import org.apache.olingo.odata2.api.edm.provider.EntityType; //导入依赖的package包/类
public static void build(final JPAEdmEntityTypeView view) {

    EntityType edmEntityType = view.getEdmEntityType();
    String jpaEntityName = view.getJPAEntityType().getName();
    JPAEdmMappingModelAccess mappingModelAccess = view.getJPAEdmMappingModelAccess();
    String edmEntityTypeName = null;
    if (mappingModelAccess != null && mappingModelAccess.isMappingModelExists()) {
      edmEntityTypeName = mappingModelAccess.mapJPAEntityType(jpaEntityName);
    }

    JPAEdmMapping mapping = new JPAEdmMappingImpl();
    mapping.setJPAType(view.getJPAEntityType().getJavaType());

    if (edmEntityTypeName == null) {
      edmEntityTypeName = jpaEntityName;
    }
    // Setting the mapping object
    edmEntityType.setMapping(((Mapping) mapping).setInternalName(jpaEntityName));

    edmEntityType.setName(edmEntityTypeName);

  }
 
开发者ID:apache,项目名称:olingo-odata2,代码行数:23,代码来源:JPAEdmNameBuilder.java


示例10: validateEntityTypes

import org.apache.olingo.odata2.api.edm.provider.EntityType; //导入依赖的package包/类
private void validateEntityTypes() throws EntityProviderException {
  for (Map.Entry<FullQualifiedName, EntityType> entityTypes : entityTypesMap.entrySet()) {
    if (entityTypes.getValue() != null && entityTypes.getKey() != null) {
      EntityType entityType = entityTypes.getValue();
      if (entityType.getBaseType() != null) {
        FullQualifiedName baseTypeFQName = entityType.getBaseType();
        EntityType baseEntityType;
        if (!entityTypesMap.containsKey(baseTypeFQName)) {
          FullQualifiedName fqName = validateEntityTypeWithAlias(baseTypeFQName);
          baseEntityType = entityTypesMap.get(fqName);
        } else {
          baseEntityType = fetchLastBaseType(baseTypeFQName,entityTypesMap);
        }
        if (baseEntityType != null && baseEntityType.getKey() == null) {
          throw new EntityProviderException(EntityProviderException.ILLEGAL_ARGUMENT
              .addContent("Missing key for EntityType " + baseEntityType.getName()));
        }
      } else if (entityType.getKey() == null) {
        throw new EntityProviderException(EntityProviderException.ILLEGAL_ARGUMENT
            .addContent("Missing key for EntityType " + entityType.getName()));
      }
    }
  }
}
 
开发者ID:apache,项目名称:olingo-odata2,代码行数:25,代码来源:XmlMetadataConsumer.java


示例11: while

import org.apache.olingo.odata2.api.edm.provider.EntityType; //导入依赖的package包/类
private EntityType fetchLastBaseType
(FullQualifiedName baseTypeFQName, Map<FullQualifiedName, EntityType> entityTypesMap) 
    throws EntityProviderException {
  
  EntityType baseEntityType = null ;
  while(baseTypeFQName!=null){
    baseEntityType = entityTypesMap.get(baseTypeFQName);
    if(baseEntityType.getKey()!=null){
      break;
    }else if(baseEntityType !=null && baseEntityType.getBaseType() !=null){
        baseTypeFQName = baseEntityType.getBaseType();
    }else if(baseEntityType.getBaseType() == null){
      break;
    }
  }
  return baseEntityType;
}
 
开发者ID:apache,项目名称:olingo-odata2,代码行数:18,代码来源:XmlMetadataConsumer.java


示例12: before

import org.apache.olingo.odata2.api.edm.provider.EntityType; //导入依赖的package包/类
@Before
public void before() throws ODataException {
  EdmProvider edmProvider = mock(EdmProvider.class);

  EntityType entityType = new EntityType().setName("EntityType1");
  when(edmProvider.getEntityType(new FullQualifiedName("EntityType1Ns", "EntityType1"))).thenReturn(entityType);

  ComplexType complexType = new ComplexType().setName("ComplexType1");
  when(edmProvider.getComplexType(new FullQualifiedName("ComplexType1Ns", "ComplexType1"))).thenReturn(complexType);

  Association association = new Association().setName("Association1");
  when(edmProvider.getAssociation(new FullQualifiedName("Association1Ns", "Association1"))).thenReturn(association);

  EntityContainerInfo defaultEntityContainer = new EntityContainerInfo().setName("Container1");
  when(edmProvider.getEntityContainerInfo(null)).thenReturn(defaultEntityContainer);
  when(edmProvider.getEntityContainerInfo("Container1")).thenReturn(defaultEntityContainer);

  edm = new EdmImplProv(edmProvider);

}
 
开发者ID:apache,项目名称:olingo-odata2,代码行数:21,代码来源:ServiceDocumentProducerTest.java


示例13: testAlias

import org.apache.olingo.odata2.api.edm.provider.EntityType; //导入依赖的package包/类
@Test()
public void testAlias() throws XMLStreamException, EntityProviderException {
  final String xml =
      "<edmx:Edmx Version=\"1.0\" xmlns:edmx=\"" + Edm.NAMESPACE_EDMX_2007_06 + "\">"
          + "<edmx:DataServices m:DataServiceVersion=\"2.0\" xmlns:m=\"" + Edm.NAMESPACE_M_2007_08 + "\">"
          + "<Schema Namespace=\"" + NAMESPACE + "\" Alias=\"RS\"  xmlns=\"" + Edm.NAMESPACE_EDM_2008_09 + "\">"
          + "<EntityType Name= \"Employee\">" + "<Key><PropertyRef Name=\"EmployeeId\"/></Key>" + "<Property Name=\""
          + propertyNames[0] + "\" Type=\"Edm.String\" Nullable=\"false\"/>" + "</EntityType>"
          + "<EntityType Name=\"Manager\" BaseType=\"RS.Employee\" m:HasStream=\"true\">" + "</EntityType>"
          + "</Schema>" + "</edmx:DataServices>" + "</edmx:Edmx>";
  XmlMetadataConsumer parser = new XmlMetadataConsumer();
  XMLStreamReader reader = createStreamReader(xml);
  DataServices result = parser.readMetadata(reader, true);
  for (Schema schema : result.getSchemas()) {
    assertEquals("RS", schema.getAlias());
    for (EntityType entityType : schema.getEntityTypes()) {
      if ("Manager".equals(entityType.getName())) {
        assertEquals("Employee", entityType.getBaseType().getName());
        assertEquals("RS", entityType.getBaseType().getNamespace());
      }
    }

  }
}
 
开发者ID:apache,项目名称:olingo-odata2,代码行数:25,代码来源:XmlMetadataConsumerTest.java


示例14: testEntityType

import org.apache.olingo.odata2.api.edm.provider.EntityType; //导入依赖的package包/类
@Test
public void testEntityType() throws Exception {
  Edm edm = createEdm();

  assertNotNull(edm);
  FullQualifiedName fqNameEmployee = new FullQualifiedName("RefScenario", "Employee");
  EdmProvider testProvider = new EdmTestProvider();
  EdmImplProv edmImpl = (EdmImplProv) edm;
  EntityType employee = edmImpl.getEdmProvider().getEntityType(fqNameEmployee);
  EntityType testEmployee = testProvider.getEntityType(fqNameEmployee);
  assertEquals(testEmployee.getName(), employee.getName());
  assertEquals(testEmployee.isHasStream(), employee.isHasStream());
  assertEquals(testEmployee.getProperties().size(), employee.getProperties().size());
  assertEquals(testEmployee.getNavigationProperties().size(), employee.getNavigationProperties().size());

}
 
开发者ID:apache,项目名称:olingo-odata2,代码行数:17,代码来源:EdmxProviderTest.java


示例15: setup

import org.apache.olingo.odata2.api.edm.provider.EntityType; //导入依赖的package包/类
@BeforeClass
public static void setup() throws Exception {

  edmProvider = mock(EdmProvider.class);
  EdmImplProv edmImplProv = new EdmImplProv(edmProvider);

  FullQualifiedName relationship = new FullQualifiedName("namespace", "associationName");
  Association association = new Association().setName("associationName");
  when(edmProvider.getAssociation(relationship)).thenReturn(association);

  AssociationEnd end1 = new AssociationEnd().setRole("fromRole");
  FullQualifiedName entityName = new FullQualifiedName("namespace", "entityName");
  AssociationEnd end2 =
      new AssociationEnd().setRole("toRole").setMultiplicity(EdmMultiplicity.ONE).setType(entityName);
  association.setEnd1(end1).setEnd2(end2);

  EntityType entityType = new EntityType().setName("entityName");
  when(edmProvider.getEntityType(entityName)).thenReturn(entityType);

  NavigationProperty navProperty =
      new NavigationProperty().setName("navProperty").setFromRole("fromRole").setToRole("toRole").setRelationship(
          relationship);
  navPropertyProvider = new EdmNavigationPropertyImplProv(edmImplProv, navProperty);
}
 
开发者ID:apache,项目名称:olingo-odata2,代码行数:25,代码来源:EdmNavigationPropertyImplProvTest.java


示例16: getEntityType

import org.apache.olingo.odata2.api.edm.provider.EntityType; //导入依赖的package包/类
@Override
public EntityType getEntityType ()
{
   List<Property> properties = new ArrayList<Property> ();
   properties.add (new SimpleProperty ().setName (ID)
      .setType (EdmSimpleTypeKind.String)
      .setFacets (new Facets ().setNullable (false)));
   properties.add (new SimpleProperty ()
      .setName (NAME)
      .setType (EdmSimpleTypeKind.String)
      .setCustomizableFeedMappings (
         new CustomizableFeedMappings ()
            .setFcTargetPath (EdmTargetPath.SYNDICATION_TITLE)));
   properties.add (new SimpleProperty ().setName (CONTENT_TYPE).setType (
      EdmSimpleTypeKind.String));
   properties.add (new SimpleProperty ().setName (CONTENT_LENGTH).setType (
      EdmSimpleTypeKind.Int64));

   // Key
   Key key =
      new Key ().setKeys (Collections.singletonList (new PropertyRef ()
         .setName (ID)));

   // TODO (OData v3) setOpenType(true) setAbstract(true)
   return new EntityType ().setName (ENTITY_NAME).setProperties (properties)
      .setKey (key);
}
 
开发者ID:SentinelDataHub,项目名称:dhus-core,代码行数:28,代码来源:ItemEntitySet.java


示例17: getEntityType

import org.apache.olingo.odata2.api.edm.provider.EntityType; //导入依赖的package包/类
@Override
public EntityType getEntityType ()
{
   // Properties
   List<Property> properties = new ArrayList<Property> ();

   properties.add (new SimpleProperty ()
   .setName (ID)
   .setType (EdmSimpleTypeKind.Int64)
   .setFacets (new Facets ().setNullable (false))
   .setCustomizableFeedMappings (
      new CustomizableFeedMappings ()
         .setFcTargetPath (EdmTargetPath.SYNDICATION_TITLE)));

   // Key
   Key key =
      new Key ().setKeys (Collections.singletonList (new PropertyRef ()
         .setName (ID)));

   // Navigation Properties
   List<NavigationProperty> navigationProperties =
      new ArrayList<NavigationProperty> ();

   if (Security.currentUserHasRole(Role.STATISTICS))
   {
      navigationProperties.add (new NavigationProperty ()
         .setName ("NetworkStatistic")
         .setRelationship (ASSO_NETWORK_NETWORKSTATISTIC)
         .setFromRole (ROLE_NETWORKSTATISTIC_NETWORK)
         .setToRole (ROLE_NETWORK_NETWORKSTATISTIC));
   }

   return new EntityType ().setName (ENTITY_NAME).setProperties (properties)
      .setKey (key).setNavigationProperties (navigationProperties);
}
 
开发者ID:SentinelDataHub,项目名称:dhus-core,代码行数:36,代码来源:NetworkEntitySet.java


示例18: getEntityType

import org.apache.olingo.odata2.api.edm.provider.EntityType; //导入依赖的package包/类
@Override
public EntityType getEntityType ()
{
   List<Property> properties = new ArrayList<> ();

   SimpleProperty uuid = new SimpleProperty ();
   uuid.setName (UUID);
   uuid.setType (EdmSimpleTypeKind.String);
   uuid.setFacets (new Facets ().setNullable (false));
   uuid.setCustomizableFeedMappings (new CustomizableFeedMappings ()
         .setFcTargetPath (EdmTargetPath.SYNDICATION_TITLE));
   properties.add (uuid);

   SimpleProperty restriction_type = new SimpleProperty ();
   restriction_type.setName (RESTRICTION_TYPE);
   restriction_type.setType (EdmSimpleTypeKind.String);
   restriction_type.setFacets (new Facets ().setNullable (false));
   properties.add (restriction_type);

   SimpleProperty reason = new SimpleProperty ();
   reason.setName (REASON);
   reason.setType (EdmSimpleTypeKind.String);
   reason.setFacets (new Facets ().setNullable (false));
   properties.add (reason);

   Key key = new Key ();
   List<PropertyRef> propertyRefs = Collections.singletonList (
         new PropertyRef ().setName (UUID));
   key.setKeys (propertyRefs);

   EntityType entityType = new EntityType ();
   entityType.setName (ENTITY_NAME);
   entityType.setProperties (properties);
   entityType.setKey (key);

   return entityType;
}
 
开发者ID:SentinelDataHub,项目名称:dhus-core,代码行数:38,代码来源:RestrictionEntitySet.java


示例19: getEntityType

import org.apache.olingo.odata2.api.edm.provider.EntityType; //导入依赖的package包/类
@Override
public EntityType getEntityType ()
{
   EntityType res = Model.ITEM.getEntityType();

   res.getProperties ().add (
      new SimpleProperty ().setName (CHILDREN_NUMBER).setType (
         EdmSimpleTypeKind.Int64));
   res.getProperties ().add (
      new SimpleProperty ().setName (VALUE).setType (
         EdmSimpleTypeKind.String));

   // Navigation Properties
   List<NavigationProperty> navigationProperties =
      new ArrayList<NavigationProperty> ();
   // TODO (OData v3) setContainsTarget(true)
   navigationProperties.add (new NavigationProperty ().setName (getName ())
      .setRelationship (ASSO_NODE_NODE).setFromRole (ROLE_NODE_PARENT)
      .setToRole (ROLE_NODE_NODES));
   navigationProperties.add (new NavigationProperty ()
      .setName(Model.ATTRIBUTE.getName())
      .setRelationship (ASSO_NODE_ATTRIBUTE)
      .setFromRole (ROLE_ATTRIBUTE_NODE).setToRole (ROLE_NODE_ATTRIBUTES));
   navigationProperties.add (new NavigationProperty ()
      .setName ("Class")
      .setRelationship (ASSO_NODE_CLASS)
      .setFromRole (ROLE_CLASS_NODES)
      .setToRole (ROLE_NODE_CLASS));

   // TODO (OData v3) setAbstract(true) setBaseType(ENTITY_ITEM)
   return res.setName (ENTITY_NAME)
      .setNavigationProperties (navigationProperties).setHasStream (true);
}
 
开发者ID:SentinelDataHub,项目名称:dhus-core,代码行数:34,代码来源:NodeEntitySet.java


示例20: getEntityType

import org.apache.olingo.odata2.api.edm.provider.EntityType; //导入依赖的package包/类
@Override
public EntityType getEntityType ()
{
   // Properties
   List<Property> properties = new ArrayList<Property> ();

   properties.add (new SimpleProperty ()
   .setName (ID)
   .setType (EdmSimpleTypeKind.Int64)
   .setFacets (new Facets ().setNullable (false))
   .setCustomizableFeedMappings (
      new CustomizableFeedMappings ()
         .setFcTargetPath (EdmTargetPath.SYNDICATION_TITLE)));

   properties.add (new SimpleProperty ()
      .setName (ACTIVITYPERIOD)
      .setType (EdmSimpleTypeKind.Int64));

   properties.add (new SimpleProperty ()
      .setName (CONNECTIONNUMBER)
      .setType (EdmSimpleTypeKind.Int64));
   // Key
   Key key =
      new Key ().setKeys (Collections.singletonList (new PropertyRef ()
         .setName (ID)));

   return new EntityType ().setName (ENTITY_NAME).setProperties (properties)
      .setKey (key);
}
 
开发者ID:SentinelDataHub,项目名称:dhus-core,代码行数:30,代码来源:NetworkStatisticEntitySet.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Box类代码示例发布时间:2022-05-22
下一篇:
Java ResourceNotFoundException类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap