简体   繁体   English

vdm 生成的没有 getter 的类

[英]vdm generated class without getters

When generating Odata classes with vdm, the entity class does not have getters defined for each field.使用 vdm 生成 Odata 类时,实体类没有为每个字段定义 getter。 Example: getBpdid(), getChangeFlag(),etc.示例:getBpdid()、getChangeFlag() 等。 are missing.缺失。 I am using S4 HANA SDK 2.9.1 and Spring Boot 2.1.3我正在使用 S4 HANA SDK 2.9.1 和 Spring Boot 2.1.3

Here is the configuration of the generator:这是生成器的配置:

<configuration>
   <inputDirectory>${project.basedir}/edmx</inputDirectory>
   <outputDirectory>${project.build.directory}/vdm</outputDirectory>
   <deleteOutputDirectory>true</deleteOutputDirectory>
   <packageName>com.sap.scenario.vdm</packageName>
   <nameSource>NAME</nameSource>
   <includeFunctionImports>
      <params>none</params>
   </includeFunctionImports>
   <includeEntitySets>
      <params>ScenarioSet</params>
   </includeEntitySets>
</configuration>

And the EDMX definition of the entity type:以及实体类型的 EDMX 定义:

</EntityType>
<EntityType Name="Scenario" sap:content-version="1">
<Key>
<PropertyRef Name="Bpdid"/>
</Key>
<Property Name="Bpdid" Type="Edm.String" Nullable="false" MaxLength="40" sap:unicode="false" sap:label="Text, 40 Characters Long" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
<Property Name="ChangeFlag" Type="Edm.String" MaxLength="1" sap:unicode="false" sap:label="Change flag for an automate" sap:creatable="false" sap:updatable="false" sap:sortable="false"/>
<Property Name="BpdUrl" Type="Edm.String" Nullable="false" MaxLength="1024" sap:unicode="false" sap:label="String" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
<Property Name="CountryName" Type="Edm.String" Nullable="false" MaxLength="15" sap:unicode="false" sap:label="CountryName" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
<Property Name="Bpdsid" Type="Edm.String" Nullable="false" MaxLength="255" sap:unicode="false" sap:label="process name" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
<Property Name="UpgradeSel" Type="Edm.Boolean" Nullable="false" sap:unicode="false" sap:label="Indicator" sap:creatable="false" sap:updatable="false" sap:sortable="false"/>
<Property Name="Bpdtype" Type="Edm.String" MaxLength="50" sap:unicode="false" sap:label="Explanation" sap:creatable="false" sap:updatable="false" sap:sortable="false"/>
<Property Name="Country" Type="Edm.String" MaxLength="50" sap:unicode="false" sap:label="c" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
<Property Name="Status" Type="Edm.String" MaxLength="1" sap:unicode="false" sap:label="Char01" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
<Property Name="App" Type="Edm.String" MaxLength="20" sap:unicode="false" sap:label="Description" sap:updatable="false" sap:sortable="false"/>
<Property Name="Bpdname" Type="Edm.String" Nullable="false" MaxLength="255" sap:unicode="false" sap:label="Text" sap:updatable="false" sap:sortable="false"/>
<Property Name="Changed" Type="Edm.String" MaxLength="1" sap:unicode="false" sap:label="Indicator" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
<Property Name="Uname" Type="Edm.String" MaxLength="80" sap:unicode="false" sap:label="User name" sap:creatable="false" sap:updatable="false" sap:filterable="false"/>
<Property Name="Createstamp" Type="Edm.DateTime" Precision="0" sap:unicode="false" sap:label="Time Stamp" sap:creatable="false" sap:updatable="false" sap:filterable="false"/>
<Property Name="LockName" Type="Edm.String" MaxLength="80" sap:unicode="false" sap:label="User name" sap:creatable="false" sap:updatable="false"/>
<Property Name="ChangeTime" Type="Edm.DateTime" Precision="0" sap:unicode="false" sap:label="Time Stamp" sap:creatable="false" sap:updatable="false"/>
<Property Name="rel" Type="Edm.String" MaxLength="10" sap:unicode="false" sap:label="SAP Release" sap:creatable="false" sap:updatable="false"/>
<NavigationProperty Name="options" Relationship="e2eie_ic_mngcldsol.options" FromRole="FromRole_options" ToRole="ToRole_options"/>
<NavigationProperty Name="ProcedureSet" Relationship="e2eie_ic_mngcldsol.Scenario_Procedure" FromRole="FromRole_Scenario_Procedure" ToRole="ToRole_Scenario_Procedure"/>
</EntityType>

To be able to use Lombok in Spring Test Tool I needed to install the library. 为了能够在Spring Test Tool中使用Lombok,我需要安装库。 Same problem described here: Lombok not working with STS 这里描述的问题相同: Lombok没有使用STS

I had the same issue "getter not generated" event though I installed the lombok in my eclipse oxygen, according to the link: 我有同样的问题“getter not generated”事件,虽然我在我的日食氧气中安装了lombok,根据链接:

I also added the lombok dependency to my project pom file according to the tutorial: 我还根据教程将lombok依赖项添加到我的项目pom文件中:

Any idea why the getter is still missing in the generated source? 知道为什么生成的源中仍然缺少getter?

Best Cong 最好的丛

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM