Skip to Content
0
Jul 28, 2023 at 04:46 PM

CAP CDS import leads to error "variable XYZ is already defined in interface"

184 Views

Hello all,

I am trying to import the metadata of the official "Condition Contract API" into my Java CAP project. The my compile leads to the error message that the variable is already defined. And that for all entities. Im just using "cds import ../../api.edmx --as cds".

The problem is the following:

For example, the entity CndnContrConditionRecord has the key field "ConditionContract", which becomes "CONDITION_CONTRACT" when compiled. At the same time the entity has the field "_ConditionContract" which also becomes "CONDITION_CONTRACT". Now of course I have a problem.

Is there a trick here? Is this the way it is supposed to be? Is this a bug?

I used the annotation @cds.java.name in another API import, but in this API I have to adjust dozens of fields, and I can imagine that this leads to problems, especially that I want to use the naviogation features.

Thanks!