0

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

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

edmx.xml:

<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> `

4

1 回答 1

0

事实证明,问题在于缺少 Lombok 配置。

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

什么是龙目岛?

根据他们的网站

Project Lombok 是一个 java 库,可自动插入您的编辑器和构建工具,为您的 java 增添趣味。永远不要再编写另一个 getter 或 equals 方法,使用一个注释,您的类就有一个功能齐全的构建器、自动化您的日志记录变量等等。

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

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

有关注释的完整列表,请参阅概述页面

你用龙目岛做什么?

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

除了其他注释之外,最后一个注释还@Getter引入了在编译时生成所有必要的 getter 的注释。

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

正如Lombok和我们的博客文章直接描述的那样,您只需要 Lombok 依赖项 ( org.projectlombok:lombok) 并在您的类路径上具有范围provided

要查看 IDE 中的代码而没有任何构建问题,您需要相应地设置 IDE,请参阅Lombok 指南

于 2019-03-12T09:47:11.290 回答