首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用S/4 HANA SDK生成OData VDM导致错误

使用S/4 HANA SDK生成OData VDM导致错误
EN

Stack Overflow用户
提问于 2019-03-09 09:20:17
回答 1查看 269关注 0票数 0

我尝试为S/4 HANA Cloud提供的OData服务生成VDM (它不在API集线器中)。生成的VDM类显示错误,特别是它具有UUID set和get方法以及TRUE属性的错误。我在这里附加了元数据edmx.xml。

此XML文件似乎没有任何与其关联的样式信息。文档树如下所示。

edmx.xml:

代码语言:javascript
复制
<edmx:Edmx xmlns:edmx="http://schemas.microsoft.com/ado/2007/06/edmx" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:sap="http://www.sap.com/Protocols/SAPData" Version="1.0">
<edmx:Reference xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx" Uri="https://my300470-api.s4hana.ondemand.com/sap/opu/odata/IWFND/CATALOGSERVICE;v=2/Vocabularies(TechnicalName='%2FIWBEP%2FVOC_COMMON',Version='0001',SAP__Origin='LOCAL')/$value">
<edmx:Include Namespace="com.sap.vocabularies.Common.v1" Alias="Common"/>
</edmx:Reference>
<edmx:Reference xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx" Uri="https://my300470-api.s4hana.ondemand.com/sap/opu/odata/IWFND/CATALOGSERVICE;v=2/Vocabularies(TechnicalName='%2FIWBEP%2FVOC_CAPABILITIES',Version='0001',SAP__Origin='LOCAL')/$value">
<edmx:Include Namespace="Org.OData.Capabilities.V1" Alias="Capabilities"/>
</edmx:Reference>
<edmx:Reference xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx" Uri="https://my300470-api.s4hana.ondemand.com/sap/opu/odata/IWFND/CATALOGSERVICE;v=2/Vocabularies(TechnicalName='%2FIWBEP%2FVOC_COMMUNICATION',Version='0001',SAP__Origin='LOCAL')/$value">
<edmx:Include Namespace="com.sap.vocabularies.Communication.v1" Alias="Communication"/>
</edmx:Reference>
<edmx:Reference xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx" Uri="https://my300470-api.s4hana.ondemand.com/sap/opu/odata/IWFND/CATALOGSERVICE;v=2/Vocabularies(TechnicalName='%2FIWBEP%2FVOC_AGGREGATION',Version='0001',SAP__Origin='LOCAL')/$value">
<edmx:Include Namespace="Org.OData.Aggregation.V1" Alias="Aggregation"/>
</edmx:Reference>
<edmx:DataServices m:DataServiceVersion="2.0">
<Schema xmlns="http://schemas.microsoft.com/ado/2008/09/edm" Namespace="APS_IAM_SIAG_BROLE_SRV" xml:lang="en" sap:schema-version="1">
<EntityType Name="IagprivilegeauthDetails" sap:content-version="1">
<Key>
<PropertyRef Name="BusinessCatalogID"/>
<PropertyRef Name="PrivilegeRole"/>
</Key>
<Property Name="BusinessCatalogID" Type="Edm.String" Nullable="false" sap:unicode="false" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
<Property Name="PrivilegeRole" Type="Edm.String" Nullable="false" sap:unicode="false" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
<Property Name="PrivilegeProfile" Type="Edm.String" Nullable="false" sap:unicode="false" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
<Property Name="ActionType" Type="Edm.String" Nullable="false" sap:unicode="false" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
<Property Name="AuthGroup" Type="Edm.String" Nullable="false" sap:unicode="false" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
<Property Name="ResourceId" Type="Edm.String" Nullable="false" sap:unicode="false" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
<Property Name="ResourceExtn" Type="Edm.String" Nullable="false" sap:unicode="false" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
<Property Name="FromValue" Type="Edm.String" Nullable="false" sap:unicode="false" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
<Property Name="ToValue" Type="Edm.String" Nullable="false" sap:unicode="false" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
<Property Name="FioriCatalogId" Type="Edm.String" Nullable="false" sap:unicode="false" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
</EntityType>
<EntityType Name="aps_iam_brbua_ddlType" sap:label="Business Role Business User Assignment" sap:content-version="1">
<Key>
<PropertyRef Name="BusinessRoleUUID"/>
<PropertyRef Name="BusinessUserAssignmentID"/>
</Key>
<Property Name="BusinessRoleUUID" Type="Edm.Guid" Nullable="false" sap:label="Business Role UUID"/>
<Property Name="BusinessUserAssignmentID" Type="Edm.String" Nullable="false" MaxLength="12" sap:display-format="UpperCase" sap:label="Business User Assignment ID"/>
<Property Name="UserID" Type="Edm.String" MaxLength="12" sap:display-format="UpperCase" sap:label="Business User ID"/>
<Property Name="UserName" Type="Edm.String" MaxLength="40" sap:display-format="UpperCase" sap:label="Business User Name"/>
<Property Name="FirstName" Type="Edm.String" MaxLength="40" sap:label="Business User First Name"/>
<Property Name="LastName" Type="Edm.String" MaxLength="40" sap:label="Business User Last Name"/>
<Property Name="PersonID" Type="Edm.String" MaxLength="10" sap:display-format="UpperCase" sap:label="Business User Person ID"/>
<Property Name="Building" Type="Edm.String" MaxLength="10" sap:label="Building"/>
<Property Name="Floor" Type="Edm.String" MaxLength="10" sap:label="Floor"/>
<Property Name="Room" Type="Edm.String" MaxLength="10" sap:label="Room"/>
<Property Name="PriceCategory" Type="Edm.Int16" sap:label="Price Category"/>
<Property Name="PriceCategoryText" Type="Edm.String" MaxLength="80" sap:label="Price Category"/>
</EntityType>
<EntityType Name="Aps_Iam_Siag_Brca_DllType" sap:label="Business Role - Catalog Assignment" sap:content-version="1">
<Key>
<PropertyRef Name="ID"/>
<PropertyRef Name="BusinessCatalogID"/>
</Key>
<Property Name="ID" Type="Edm.String" Nullable="false" MaxLength="40" sap:display-format="UpperCase" sap:label="Bus. Role ID" sap:quickinfo="IAM: Business Role ID"/>
<Property Name="BusinessCatalogID" Type="Edm.String" Nullable="false" MaxLength="35" sap:display-format="UpperCase" sap:label="Catalog ID" sap:quickinfo="IAM: Business Catalog ID"/>
<Property Name="BusinessRoleUUID" Type="Edm.Guid" sap:label="UUID" sap:quickinfo="Global Unique ID for table"/>
<Property Name="FioriCatalogID" Type="Edm.String" MaxLength="35" sap:display-format="UpperCase" sap:label="Fiori Catalog ID" sap:quickinfo="Fiori Catalog Type"/>
<Property Name="RoleTemplate" Type="Edm.String" MaxLength="30" sap:display-format="UpperCase" sap:label="Role Name"/>
<Property Name="Restrictable" Type="Edm.Boolean" sap:display-format="UpperCase" sap:label="Restrictable"/>
<NavigationProperty Name="to_BusinessRole" Relationship="APS_IAM_SIAG_BROLE_SRV.assoc_7D2C2868538CD70C0B433A90421C523F" FromRole="FromRole_assoc_7D2C2868538CD70C0B433A90421C523F" ToRole="ToRole_assoc_7D2C2868538CD70C0B433A90421C523F"/>
<NavigationProperty Name="to_Description" Relationship="APS_IAM_SIAG_BROLE_SRV.assoc_C2CAEB0FCF842BFF92ECFB837B9001F9" FromRole="FromRole_assoc_C2CAEB0FCF842BFF92ECFB837B9001F9" ToRole="ToRole_assoc_C2CAEB0FCF842BFF92ECFB837B9001F9"/>
</EntityType>
<EntityType Name="Aps_Iam_Siag_Br_DllType" sap:label="IAG Business Role View" sap:content-version="1">
<Key>
<PropertyRef Name="ID"/>
</Key>
<Property Name="ID" Type="Edm.String" Nullable="false" MaxLength="40" sap:display-format="UpperCase" sap:label="Bus. Role ID" sap:quickinfo="IAM: Business Role ID"/>
<Property Name="UUID" Type="Edm.Guid" sap:label="UUID" sap:quickinfo="Global Unique ID for table"/>
<Property Name="LastChangedAt" Type="Edm.DateTimeOffset" Precision="0" sap:label="Time Stamp" sap:quickinfo="UTC Time Stamp in Short Form (YYYYMMDDhhmmss)"/>
<Property Name="LastChangedBy" Type="Edm.String" MaxLength="12" sap:display-format="UpperCase" sap:label="User Name"/>
<Property Name="Description" Type="Edm.String" MaxLength="80" sap:label="" sap:quickinfo="IAM: Business Role Description"/>
<Property Name="Language" Type="Edm.String" MaxLength="2" sap:label="Language Key"/>
<NavigationProperty Name="to_BusinessCatalogAssignment" Relationship="APS_IAM_SIAG_BROLE_SRV.assoc_DFC7845EA2C63AB8EE73721D41279674" FromRole="FromRole_assoc_DFC7845EA2C63AB8EE73721D41279674" ToRole="ToRole_assoc_DFC7845EA2C63AB8EE73721D41279674"/>
<NavigationProperty Name="to_BusinessUserAssignment" Relationship="APS_IAM_SIAG_BROLE_SRV.assoc_35A670E810662891BAABAA62A25B742F" FromRole="FromRole_assoc_35A670E810662891BAABAA62A25B742F" ToRole="ToRole_assoc_35A670E810662891BAABAA62A25B742F"/>
</EntityType>
<EntityType Name="aps_iam_vbct_ddlType" sap:label="Business Catalog Text" sap:content-version="1">
<Key>
<PropertyRef Name="bu_catalog_id"/>
<PropertyRef Name="language"/>
</Key>
<Property Name="bu_catalog_id" Type="Edm.String" Nullable="false" MaxLength="35" sap:display-format="UpperCase" sap:label="Catalog ID" sap:quickinfo="IAM: Business Catalog ID"/>
<Property Name="language" Type="Edm.String" Nullable="false" MaxLength="2" sap:label="Language Key"/>
<Property Name="text" Type="Edm.String" MaxLength="80" sap:label="Business Catalog"/>
<Property Name="long_text" Type="Edm.String" sap:label="Description" sap:sortable="false" sap:filterable="false"/>
<Property Name="is_deprecated" Type="Edm.Boolean" sap:display-format="UpperCase" sap:label="TRUE" sap:quickinfo="Data element for domain BOOLE: TRUE (='X') and FALSE (=' ')"/>
</EntityType>
<Association Name="assoc_C2CAEB0FCF842BFF92ECFB837B9001F9" sap:content-version="1">
<End Type="APS_IAM_SIAG_BROLE_SRV.Aps_Iam_Siag_Brca_DllType" Multiplicity="1" Role="FromRole_assoc_C2CAEB0FCF842BFF92ECFB837B9001F9"/>
<End Type="APS_IAM_SIAG_BROLE_SRV.aps_iam_vbct_ddlType" Multiplicity="*" Role="ToRole_assoc_C2CAEB0FCF842BFF92ECFB837B9001F9"/>
</Association>
<Association Name="assoc_7D2C2868538CD70C0B433A90421C523F" sap:content-version="1">
<End Type="APS_IAM_SIAG_BROLE_SRV.Aps_Iam_Siag_Brca_DllType" Multiplicity="1" Role="FromRole_assoc_7D2C2868538CD70C0B433A90421C523F"/>
<End Type="APS_IAM_SIAG_BROLE_SRV.Aps_Iam_Siag_Br_DllType" Multiplicity="0..1" Role="ToRole_assoc_7D2C2868538CD70C0B433A90421C523F"/>
</Association>
<Association Name="assoc_DFC7845EA2C63AB8EE73721D41279674" sap:content-version="1">
<End Type="APS_IAM_SIAG_BROLE_SRV.Aps_Iam_Siag_Br_DllType" Multiplicity="1" Role="FromRole_assoc_DFC7845EA2C63AB8EE73721D41279674"/>
<End Type="APS_IAM_SIAG_BROLE_SRV.Aps_Iam_Siag_Brca_DllType" Multiplicity="*" Role="ToRole_assoc_DFC7845EA2C63AB8EE73721D41279674"/>
</Association>
<Association Name="assoc_35A670E810662891BAABAA62A25B742F" sap:content-version="1">
<End Type="APS_IAM_SIAG_BROLE_SRV.Aps_Iam_Siag_Br_DllType" Multiplicity="1" Role="FromRole_assoc_35A670E810662891BAABAA62A25B742F"/>
<End Type="APS_IAM_SIAG_BROLE_SRV.aps_iam_brbua_ddlType" Multiplicity="*" Role="ToRole_assoc_35A670E810662891BAABAA62A25B742F"/>
</Association>
<EntityContainer Name="APS_IAM_SIAG_BROLE_SRV_Entities" m:IsDefaultEntityContainer="true" sap:supported-formats="atom json xlsx">
<EntitySet Name="IagprivilegeauthDetailsSet" EntityType="APS_IAM_SIAG_BROLE_SRV.IagprivilegeauthDetails" sap:creatable="false" sap:updatable="false" sap:deletable="false" sap:searchable="true" sap:content-version="1"/>
<EntitySet Name="aps_iam_brbua_ddl" EntityType="APS_IAM_SIAG_BROLE_SRV.aps_iam_brbua_ddlType" sap:creatable="false" sap:updatable="false" sap:deletable="false" sap:content-version="1"/>
<EntitySet Name="Aps_Iam_Siag_Brca_Dll" EntityType="APS_IAM_SIAG_BROLE_SRV.Aps_Iam_Siag_Brca_DllType" sap:creatable="false" sap:updatable="false" sap:deletable="false" sap:content-version="1"/>
<EntitySet Name="Aps_Iam_Siag_Br_Dll" EntityType="APS_IAM_SIAG_BROLE_SRV.Aps_Iam_Siag_Br_DllType" sap:creatable="false" sap:updatable="false" sap:deletable="false" sap:content-version="1"/>
<EntitySet Name="aps_iam_vbct_ddl" EntityType="APS_IAM_SIAG_BROLE_SRV.aps_iam_vbct_ddlType" sap:creatable="false" sap:updatable="false" sap:deletable="false" sap:content-version="1"/>
<AssociationSet Name="assoc_35A670E810662891BAABAA62A25B742F" Association="APS_IAM_SIAG_BROLE_SRV.assoc_35A670E810662891BAABAA62A25B742F" sap:creatable="false" sap:updatable="false" sap:deletable="false" sap:content-version="1">
<End EntitySet="Aps_Iam_Siag_Br_Dll" Role="FromRole_assoc_35A670E810662891BAABAA62A25B742F"/>
<End EntitySet="aps_iam_brbua_ddl" Role="ToRole_assoc_35A670E810662891BAABAA62A25B742F"/>
</AssociationSet>
<AssociationSet Name="assoc_7D2C2868538CD70C0B433A90421C523F" Association="APS_IAM_SIAG_BROLE_SRV.assoc_7D2C2868538CD70C0B433A90421C523F" sap:creatable="false" sap:updatable="false" sap:deletable="false" sap:content-version="1">
<End EntitySet="Aps_Iam_Siag_Brca_Dll" Role="FromRole_assoc_7D2C2868538CD70C0B433A90421C523F"/>
<End EntitySet="Aps_Iam_Siag_Br_Dll" Role="ToRole_assoc_7D2C2868538CD70C0B433A90421C523F"/>
</AssociationSet>
<AssociationSet Name="assoc_C2CAEB0FCF842BFF92ECFB837B9001F9" Association="APS_IAM_SIAG_BROLE_SRV.assoc_C2CAEB0FCF842BFF92ECFB837B9001F9" sap:creatable="false" sap:updatable="false" sap:deletable="false" sap:content-version="1">
<End EntitySet="Aps_Iam_Siag_Brca_Dll" Role="FromRole_assoc_C2CAEB0FCF842BFF92ECFB837B9001F9"/>
<End EntitySet="aps_iam_vbct_ddl" Role="ToRole_assoc_C2CAEB0FCF842BFF92ECFB837B9001F9"/>
</AssociationSet>
<AssociationSet Name="assoc_DFC7845EA2C63AB8EE73721D41279674" Association="APS_IAM_SIAG_BROLE_SRV.assoc_DFC7845EA2C63AB8EE73721D41279674" sap:creatable="false" sap:updatable="false" sap:deletable="false" sap:content-version="1">
<End EntitySet="Aps_Iam_Siag_Br_Dll" Role="FromRole_assoc_DFC7845EA2C63AB8EE73721D41279674"/>
<End EntitySet="Aps_Iam_Siag_Brca_Dll" Role="ToRole_assoc_DFC7845EA2C63AB8EE73721D41279674"/>
</AssociationSet>
<FunctionImport Name="getBusinessCatalogAuthDetails" ReturnType="Collection(APS_IAM_SIAG_BROLE_SRV.IagprivilegeauthDetails)" EntitySet="IagprivilegeauthDetailsSet" m:HttpMethod="GET" sap:action-for="APS_IAM_SIAG_BROLE_SRV.IagprivilegeauthDetails">
<Parameter Name="BusinessCatalogID" Type="Edm.String" Mode="In" MaxLength="40"/>
<Parameter Name="ID" Type="Edm.String" Mode="In" MaxLength="40"/>
</FunctionImport>
<FunctionImport Name="getAuthDetails" ReturnType="Collection(APS_IAM_SIAG_BROLE_SRV.IagprivilegeauthDetails)" EntitySet="IagprivilegeauthDetailsSet" m:HttpMethod="GET" sap:action-for="APS_IAM_SIAG_BROLE_SRV.IagprivilegeauthDetails">
<Parameter Name="ID" Type="Edm.String" Mode="In"/>
</FunctionImport>
</EntityContainer>
<Annotations xmlns="http://docs.oasis-open.org/odata/ns/edm" Target="APS_IAM_SIAG_BROLE_SRV.APS_IAM_SIAG_BROLE_SRV_Entities">
<Annotation Term="Aggregation.ApplySupported">
<Record>
<PropertyValue Property="Transformations">
<Collection>
<String>aggregate</String>
<String>groupby</String>
<String>filter</String>
</Collection>
</PropertyValue>
<PropertyValue Property="Rollup" EnumMember="None"/>
</Record>
</Annotation>
</Annotations>
<Annotations xmlns="http://docs.oasis-open.org/odata/ns/edm" Target="APS_IAM_SIAG_BROLE_SRV.APS_IAM_SIAG_BROLE_SRV_Entities/aps_iam_vbct_ddl">
<Annotation Term="Capabilities.FilterRestrictions">
<Record>
<PropertyValue Property="FilterExpressionRestrictions">
<Collection>
<Record>
<PropertyValue Property="Property" PropertyPath="long_text"/>
<PropertyValue Property="AllowedExpressions" String="SearchExpression"/>
</Record>
</Collection>
</PropertyValue>
<PropertyValue Property="NonFilterableProperties">
<Collection>
<PropertyPath>long_text</PropertyPath>
</Collection>
</PropertyValue>
</Record>
</Annotation>
<Annotation Term="Capabilities.SortRestrictions">
<Record>
<PropertyValue Property="NonSortableProperties">
<Collection>
<PropertyPath>long_text</PropertyPath>
<PropertyPath>long_text</PropertyPath>
</Collection>
</PropertyValue>
</Record>
</Annotation>
</Annotations>
<atom:link xmlns:atom="http://www.w3.org/2005/Atom" rel="self" href="https://my300470-api.s4hana.ondemand.com/sap/opu/odata/SAP/APS_IAM_SIAG_BROLE_SRV/$metadata"/>
<atom:link xmlns:atom="http://www.w3.org/2005/Atom" rel="latest-version" href="https://my300470-api.s4hana.ondemand.com/sap/opu/odata/SAP/APS_IAM_SIAG_BROLE_SRV/$metadata"/>
</Schema>
</edmx:DataServices>
</edmx:Edmx> `
EN

回答 1

Stack Overflow用户

发布于 2019-03-12 17:47:11

原来问题是缺少Lombok配置。

由于这个问题被问了很多次,我将给出一个比“配置它”更全面的答案,回答最常见的问题。

Lombok是什么?

根据他们的website

Project Lombok是一个java库,它可以自动插入到您的编辑器和构建工具中,为您的java增色不少。永远不要再编写另一个getter或equals方法,只需使用一个注释,您的类就拥有了一个功能齐全的构建器,自动化了您的日志变量,等等。

更具体地说,Lombok允许您向代码添加注释,这将在编译时生成样板。

因此,以@EqualsAndHashCode为例:顾名思义,这将为带注释的类生成有效的equals(Object)hashCode()方法。

有关注释的完整列表,请参阅overview page

你用Lombok做什么?

我们在OData VDM生成器中使用以下注释(不是完整列表,将来也可能会更改):

最后一个注释引入了@Getter注释,该注释在编译时生成所有必要的getter。

如何使用Lombok编译代码/在IDE中显示代码?

正如Lombok和我们的blog post直接描述的那样,您只需要在类路径上使用Lombok依赖项(org.projectlombok:lombok)和provided作用域。

要在您的集成开发环境中查看代码而没有任何构建问题,您需要相应地设置您的集成开发环境,请参阅Lombok guides

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/55073079

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档