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

Java Property类代码示例

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

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



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

示例1: extendJPAEdmSchema

import org.apache.olingo.odata2.api.edm.provider.Property; //导入依赖的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: entityTypeEmployee

import org.apache.olingo.odata2.api.edm.provider.Property; //导入依赖的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


示例3: facetsTest

import org.apache.olingo.odata2.api.edm.provider.Property; //导入依赖的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


示例4: complexTypeLocation

import org.apache.olingo.odata2.api.edm.provider.Property; //导入依赖的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


示例5: normalizeComplexKey

import org.apache.olingo.odata2.api.edm.provider.Property; //导入依赖的package包/类
public void normalizeComplexKey(final ComplexType complexType, final List<PropertyRef> propertyRefList) {
  for (Property property : complexType.getProperties()) {
    try {

      SimpleProperty simpleProperty = (SimpleProperty) property;
      Facets facets = (Facets) simpleProperty.getFacets();
      if (facets == null) {
        simpleProperty.setFacets(new Facets().setNullable(false));
      } else {
        facets.setNullable(false);
      }
      PropertyRef propertyRef = new PropertyRef();
      propertyRef.setName(simpleProperty.getName());
      propertyRefList.add(propertyRef);

    } catch (ClassCastException e) {
      ComplexProperty complexProperty = (ComplexProperty) property;
      normalizeComplexKey(complexTypeView.searchEdmComplexType(complexProperty.getType()), propertyRefList);
    }

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


示例6: testExpandEdmComplexType

import org.apache.olingo.odata2.api.edm.provider.Property; //导入依赖的package包/类
@Test
public void testExpandEdmComplexType() {
  ComplexType complexType = new ComplexType();
  List<Property> properties = new ArrayList<Property>();
  JPAEdmMapping mapping1 = new JPAEdmMappingImpl();
  mapping1.setJPAColumnName("LINEITEMID");
  ((Mapping) mapping1).setInternalName("LineItemKey.LiId");
  JPAEdmMapping mapping2 = new JPAEdmMappingImpl();
  mapping2.setJPAColumnName("LINEITEMNAME");
  ((Mapping) mapping2).setInternalName("LineItemKey.LiName");
  properties.add(new SimpleProperty().setName("LIID").setMapping((Mapping) mapping1));
  properties.add(new SimpleProperty().setName("LINAME").setMapping((Mapping) mapping2));
  complexType.setProperties(properties);
  List<Property> expandedList = null;
  try {
    objComplexType.expandEdmComplexType(complexType, expandedList, "SalesOrderItemKey");
  } catch (ClassCastException e) {
    assertTrue(false);
  }
  assertTrue(true);

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


示例7: getPropertyNames

import org.apache.olingo.odata2.api.edm.provider.Property; //导入依赖的package包/类
@Override
public List<String> getPropertyNames() throws EdmException {
  if (edmPropertyNames == null) {
    final List<String> temp = new ArrayList<String>();
    if (edmBaseType != null) {
      temp.addAll(edmBaseType.getPropertyNames());
    }
    if (structuralType.getProperties() != null) {
      for (final Property property : structuralType.getProperties()) {
        temp.add(property.getName());
      }
    }
    edmPropertyNames = temp;
  }

  return edmPropertyNames;
}
 
开发者ID:apache,项目名称:olingo-odata2,代码行数:18,代码来源:EdmStructuralTypeImplProv.java


示例8: stringValueForMaxLegthFacet

import org.apache.olingo.odata2.api.edm.provider.Property; //导入依赖的package包/类
@Test
public void stringValueForMaxLegthFacet() throws Exception {
  XmlMetadataConsumer parser = new XmlMetadataConsumer();
  XMLStreamReader reader = createStreamReader(xmlWithStringValueForMaxLengthFacet);
  DataServices result = parser.readMetadata(reader, true);

  List<Property> properties = result.getSchemas().get(0).getEntityTypes().get(0).getProperties();
  assertEquals(2, properties.size());

  Property property = getForName(properties, "Id");
  EdmFacets facets = property.getFacets();
  assertEquals(new Integer(Integer.MAX_VALUE), facets.getMaxLength());

  property = getForName(properties, "Name");
  facets = property.getFacets();
  assertEquals(new Integer(Integer.MAX_VALUE), facets.getMaxLength());
}
 
开发者ID:apache,项目名称:olingo-odata2,代码行数:18,代码来源:XmlMetadataConsumerTest.java


示例9: testBaseType

import org.apache.olingo.odata2.api.edm.provider.Property; //导入依赖的package包/类
@Test
public void testBaseType() throws XMLStreamException, EntityProviderException {
  int i = 0;
  XmlMetadataConsumer parser = new XmlMetadataConsumer();
  XMLStreamReader reader = createStreamReader(xmlWithBaseType);
  DataServices result = parser.readMetadata(reader, true);
  assertEquals("2.0", result.getDataServiceVersion());
  for (Schema schema : result.getSchemas()) {
    assertEquals(NAMESPACE, schema.getNamespace());
    assertEquals(2, schema.getEntityTypes().size());
    assertEquals("Employee", schema.getEntityTypes().get(0).getName());
    for (PropertyRef propertyRef : schema.getEntityTypes().get(0).getKey().getKeys()) {
      assertEquals("EmployeeId", propertyRef.getName());
    }
    for (Property property : schema.getEntityTypes().get(0).getProperties()) {
      assertEquals(propertyNames[i], property.getName());
      i++;
    }

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


示例10: createProperty

import org.apache.olingo.odata2.api.edm.provider.Property; //导入依赖的package包/类
@SuppressWarnings("nls")
private Property createProperty(Field field) {
	switch (field.getType().getCanonicalName()) {
	case "java.lang.String":
		return createProperty(field.getName(), EdmSimpleTypeKind.String);
	case "java.lang.Short":
	case "short":
		return createProperty(field.getName(), EdmSimpleTypeKind.Int16);
	case "java.lang.Integer":
	case "int":
		return createProperty(field.getName(), EdmSimpleTypeKind.Int32);
	case "java.lang.Long":
	case "long":
		return createProperty(field.getName(), EdmSimpleTypeKind.Int64);
	case "java.lang.Boolean":
	case "boolean":
		return createProperty(field.getName(), EdmSimpleTypeKind.Boolean);
	case "java.lang.Double":
	case "double":
		return createProperty(field.getName(), EdmSimpleTypeKind.Double);
	default:
		String errMsg = String.format("Unsupported type [%s} for property [%s]!", field.getType().getCanonicalName(), field.getName());
		throw new IllegalArgumentException(errMsg);
	}
}
 
开发者ID:SAP,项目名称:cloud-sfsf-benefits-ext,代码行数:26,代码来源:ComplexTypesDescriber.java


示例11: getEntityType

import org.apache.olingo.odata2.api.edm.provider.Property; //导入依赖的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


示例12: getEntityType

import org.apache.olingo.odata2.api.edm.provider.Property; //导入依赖的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


示例13: getEntityType

import org.apache.olingo.odata2.api.edm.provider.Property; //导入依赖的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


示例14: getEntityType

import org.apache.olingo.odata2.api.edm.provider.Property; //导入依赖的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


示例15: getEntityType

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

   List<Property> properties = res.getProperties ();
   properties.add ((Property) new SimpleProperty ().setName (VALUE)
         .setType (EdmSimpleTypeKind.String));
   properties.add((Property) new SimpleProperty().setName(CATEGORY)
         .setType(EdmSimpleTypeKind.String)
         .setFacets(new Facets().setDefaultValue(null)));

   return res.setName (ENTITY_NAME).setProperties (properties);
}
 
开发者ID:SentinelDataHub,项目名称:dhus-core,代码行数:15,代码来源:AttributeEntitySet.java


示例16: getEntityType

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

   // Navigation Properties
   List<NavigationProperty> navigationProperties =
      Collections.singletonList(new NavigationProperty()
         .setName(Model.PRODUCT.getName())
         .setRelationship(ASSO_COLLECTION_PRODUCT)
         .setFromRole(ROLE_PRODUCT_COLLECTIONS)
         .setToRole(ROLE_COLLECTION_PRODUCTS));

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

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


示例17: getEntityType

import org.apache.olingo.odata2.api.edm.provider.Property; //导入依赖的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))
   .setCustomizableFeedMappings (
      new CustomizableFeedMappings ()
         .setFcTargetPath (EdmTargetPath.SYNDICATION_TITLE)));
   
   properties.add (new SimpleProperty ().setName (URI).setType (
      EdmSimpleTypeKind.String));
  
   // Navigation Properties
   List<NavigationProperty> navigationProperties =
      new ArrayList<NavigationProperty> ();
   // TODO (OData v3) setContainsTarget(true)
   navigationProperties.add (new NavigationProperty ().setName (getName ())
      .setRelationship (ASSO_CLASS_CLASS).setFromRole (ROLE_CLASS_PARENT)
      .setToRole (ROLE_CLASS_CLASSES));

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

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


示例18: getEntityType

import org.apache.olingo.odata2.api.edm.provider.Property; //导入依赖的package包/类
@Override
public EntityType getEntityType ()
{
   Key key = new Key ();
   List<PropertyRef> property_refs =
         Collections.singletonList (new PropertyRef ().setName (NAME));
   key.setKeys (property_refs);

   SimpleProperty name = new SimpleProperty ();
   name.setName (NAME);
   name.setType (EdmSimpleTypeKind.String);
   name.setFacets (new Facets ().setNullable (false));
   name.setCustomizableFeedMappings (new CustomizableFeedMappings ()
         .setFcTargetPath (EdmTargetPath.SYNDICATION_TITLE));

   SimpleProperty description = new SimpleProperty ();
   description.setName (DESCRIPTION);
   description.setType (EdmSimpleTypeKind.String);
   description.setFacets (new Facets ().setNullable (false));

   List<Property> properties = new ArrayList<> ();
   properties.add (name);
   properties.add (description);

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

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


示例19: getComplexTypes

import org.apache.olingo.odata2.api.edm.provider.Property; //导入依赖的package包/类
private static List<ComplexType> getComplexTypes()
{
   List<ComplexType> complexTypeList = new ArrayList<>();

   // Defines complex type TimeRange
   List<Property> timeRangeProperties = new ArrayList<>();
   timeRangeProperties.add(
         new SimpleProperty()
               .setName(TIME_RANGE_START)
               .setType(EdmSimpleTypeKind.DateTime)
               .setFacets(new Facets().setPrecision(3)));
   timeRangeProperties.add(
         new SimpleProperty()
               .setName(TIME_RANGE_END)
               .setType(EdmSimpleTypeKind.DateTime)
               .setFacets(new Facets().setPrecision(3)));
   complexTypeList.add(
         new ComplexType()
               .setName(TIME_RANGE.getName())
               .setProperties(timeRangeProperties));

   // Defines complex type Checksum
   List<Property> checksumProperties = new ArrayList<>();
   checksumProperties.add(
         new SimpleProperty()
               .setName(ALGORITHM)
               .setType(EdmSimpleTypeKind.String));
   checksumProperties.add(
         new SimpleProperty()
               .setName(VALUE)
               .setType(EdmSimpleTypeKind.String));
   complexTypeList.add(
         new ComplexType()
               .setName(CHECKSUM.getName())
               .setProperties(checksumProperties));

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


示例20: getComplexTypes

import org.apache.olingo.odata2.api.edm.provider.Property; //导入依赖的package包/类
private static List<ComplexType> getComplexTypes()
{
   List<ComplexType> complexTypeList = new ArrayList<>();

   // Defines complex type TimeRange
   List<Property> timeRangeProperties = new ArrayList<>();
   timeRangeProperties.add(
         new SimpleProperty()
               .setName(TIME_RANGE_START)
               .setType(EdmSimpleTypeKind.DateTime));
   timeRangeProperties.add(
         new SimpleProperty()
               .setName(TIME_RANGE_END)
               .setType(EdmSimpleTypeKind.DateTime));
   complexTypeList.add(
         new ComplexType()
               .setName(TIME_RANGE.getName())
               .setProperties(timeRangeProperties));

   // Defines complex type Checksum
   List<Property> checksumProperties = new ArrayList<>();
   checksumProperties.add(
         new SimpleProperty()
               .setName(ALGORITHM)
               .setType(EdmSimpleTypeKind.String));
   checksumProperties.add(
         new SimpleProperty()
               .setName(VALUE)
               .setType(EdmSimpleTypeKind.String));
   complexTypeList.add(
         new ComplexType()
               .setName(CHECKSUM.getName())
               .setProperties(checksumProperties));

   return complexTypeList;
}
 
开发者ID:SentinelDataHub,项目名称:DataHubSystem,代码行数:37,代码来源:Model.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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