简体   繁体   中英

vdm generated class without getters

When generating Odata classes with vdm, the entity class does not have getters defined for each field. Example: getBpdid(), getChangeFlag(),etc. are missing. I am using S4 HANA SDK 2.9.1 and 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:

</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. Same problem described here: Lombok not working with STS

I had the same issue "getter not generated" event though I installed the lombok in my eclipse oxygen, according to the link:

I also added the lombok dependency to my project pom file according to the tutorial:

Any idea why the getter is still missing in the generated source?

Best Cong

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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