on 01-13-2022 8:12 PM
Hi!
Could you please explain what does this warning mean?
cds] - [WARNING] db/models/bizent/schema.cds:2:8: Do not use “@cds.persistence.exists” on an entity named “hdw_bizent.adm.data.cdsBizent.Asset” in SAP HANA CDS when we also create a SAP HANA CDS context named “hdw_bizent.adm.data.cdsBizent” (in entity:"hdw_bizent.adm.data.cdsBizent.Asset")
After upgrading to a recent version we started having tons of such messages ( we have around 100 existing tables ). Tables are defined like this:
@cds.persistence.exists
Entity ![hdw_bizent.adm.data.cdsBizent.Asset] {
key ![ASSET_ID]: String(100) @title: 'ASSET_ID: Asset Id' ;
key ![ASSET_TYPE]: String(100) @title: 'ASSET_TYPE: Asset Type' ;
![ASSET_NAME]: String(255) @title: 'ASSET_NAME: Asset Name' ;
}
and later consume like this ( converting name to a lower case for rest api )
using {hdw_bizent} from './schema';
entity views.hdw_bizent.adm.data.cdsBizent.Asset as projection on hdw_bizent.adm.data.cdsBizent.Asset {
ASSET_ID as asset_id,
ASSET_TYPE as asset_type,
ASSET_NAME as asset_name,
};
the real table name is resolved in synonyms.
What is wrong here and why it is a warning? Won't it appear then later to be an error?
Thanks!
Hi pepl.booking,
We just released sap/cds-compiler@2.12.0, it contains a fix, which should eliminate the warnings if nothing is wrong with your model. Could you please check if this resolves the reported Issue?
Thanks and Best Regards,
Patrice
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
patricetao here is my cdsrc.json:
{
"requires": {
"db": {
"kind": "hana",
"model": [
"db",
"srv"
]
},
"uaa": {
"kind": "xsuaa"
},
"auth": {
"impl": "srv/auth.js"
}
},
"_hana": {
"deploy-format": "hdbtable"
},
"build": {
"nodejs": {
"edmxgeneration": true
},
"target": ".",
"tasks": [
{
"for": "hana",
"src": "db",
"options": {
"model": [
"db",
"srv"
]
}
},
{
"for": "node-cf",
"src": "srv",
"options": {
"model": [
"db",
"srv"
]
}
}
]
},
"features": {
"graphql": true
},
"odata": {
"version": "v4"
},
"data": {
"sql_mapping": "quoted" },
"auth": {
"passport": {
"strategy": "xsuaa"
}
},
"deploy": {"no_save": true}
}
I think sql_mapping:quoted allows me not have an error during deploy. Meanwhile could you be so kind to advise how should my model look like please? Do I need to use using something like hdw_bizent as hdw_bizent_renamed?
Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Petr,
thanks for your config. We think we might issue this warning too often.
We will investigate this and let you know as soon as we have a solution.
One more question though, I assume your model deploys just fine?
Best Regards,
Patrice
patricetao this is correct. luckily is just the warning - real generated code works fine.
User | Count |
---|---|
76 | |
9 | |
7 | |
6 | |
6 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.