[JBoss JIRA] (TEIID-5803) Seems to be not possible to POST a new entity via a navigation property to a collection
by Steven Hawkins (Jira)
[ https://issues.jboss.org/browse/TEIID-5803?page=com.atlassian.jira.plugin... ]
Steven Hawkins commented on TEIID-5803:
---------------------------------------
The two relevant updatable requirements are:
{quote}
20. MUST support POST of new related entities to updatable navigation properties (section 11.4.2)
21. MUST support POST to $ref to add an existing entity to an updatable related collection (section 11.4.6.1)
{quote}
So if the navigation is a collection, then you need to make the url a reference:
http://localhost:18080/odata4/svc/my_nutri_diary/Account(1)/UserD...
> Seems to be not possible to POST a new entity via a navigation property to a collection
> ---------------------------------------------------------------------------------------
>
> Key: TEIID-5803
> URL: https://issues.jboss.org/browse/TEIID-5803
> Project: Teiid
> Issue Type: Bug
> Reporter: Christoph John
> Assignee: Steven Hawkins
> Priority: Major
>
> Hello Steven,
> I am currently trying to post/create an entity in a collection via a relative binding path. Unfortunately, I always get an error saying
> {"error":{"code":null,"message":"HTTP method 'POST' not allowed for this resource."}}
> I have bound the root view to .../Account(1) from which I have a navigation property to the relevant collection. Currently I have trouble to post to collections via a navigation path.
> As far as I understood from
> http://docs.oasis-open.org/odata/odata/v4.01/csprd04/part1-protocol/odata...
> chapter 11.4.2 this should work according to my tries below.
> Might you tell me if my path via the navigation property should work for post requests or what I am doing wrong?
> Directly writing to the collection is fine, i.e. something like the following:
> curl --user sap:sap -i -X POST -H 'Content-Type: application/json;charset=UTF-8;IEEE754Compatible=true' -d '{"fkProfile":"1","idCode":null,"lc":"de","product_name":"A Product","brands":"A brand","energy_100g":2259,"carbohydrates_100g":60.08,"sugars_100g":10.1,"proteins_100g":24.03,"fat_100g":15.89,"saturated_fat_100g":10.0,"salt_100g":1.0}' http://localhost:18080/odata4/svc/my_nutri_diary/UserDefinedProducts
> and a GET request via a navigation property path (given below) also works, but a path via a navigation property does not work when using the path in a POST request. I.e. when going via the navigation property. Example:
> curl --user sap:sap -i -X POST -H 'Content-Type: application/json;charset=UTF-8;IEEE754Compatible=true' -d '{"fkProfile":"1","idCode":null,"lc":"de","product_name":"A Product","brands":"A brand","energy_100g":2259,"carbohydrates_100g":60.08,"sugars_100g":10.1,"proteins_100g":24.03,"fat_100g":15.89,"saturated_fat_100g":10.0,"salt_100g":1.0}' http://localhost:18080/odata4/svc/my_nutri_diary/Account\(1\)/UserDefined...
> Here you find the backend metadata. They show that UserDefinedProducts_fKUserDefinedProductToAccount is simply a navigaton path from Account(xxx) to the UserDefinedProducts collection.
> https://ecubed-solutions.ddnss.de/odata4/svc/my_nutri_diary/$metadata
> user: sap
> password: sap
> Thanks a lot for your help!
> Note: I am currently trying to add data via a navigation property path because my frontend library sapui5 only caches and syncs data queried via a single context binding. Hence, to be consistent via all views in my app which bind to the odata model, I need to use only one absolute binding and have to query/update other contexts via relative binding paths from this single absolute path, to allow for all frontend views to maintain data consistency
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
5 years, 4 months
[JBoss JIRA] (TEIID-5220) Add support for information_schema namespace
by Salvatore R. (Jira)
[ https://issues.jboss.org/browse/TEIID-5220?page=com.atlassian.jira.plugin... ]
Salvatore R. edited comment on TEIID-5220 at 8/19/19 5:30 AM:
--------------------------------------------------------------
[~shawkins] I have another question about the current implementation, please.
Accordingly to the PostgreSQL docs mentioned in the description, VIEWS and TABLES should return respectively:
- TABLES: all tables and views
- VIEWS: only views
but it seems that the current implementation in Teiid returns both tables and views for information_schema.TABLES but only tables (and not views) in information_schema.VIEWS. Looking at the code, the view transformation is indeed defined as:
{code:sql}select vdbname, schemaName, name, 'NONE', case when SupportsUpdates then 'YES' else 'NO' end from sys.tables where IsPhysical{code}
Is there any reason why it is implemented this way or is it maybe a bug? :)
was (Author: fox123):
[~shawkins] I have another question about the current implementation, please.
Accordingly to the PostgreSQL docs mentioned in the description, VIEWS and TABLES should return respectively:
- TABLES: all tables and views
- VIEWS: only views
but it seems that the current implementation in Teiid returns both tables and views for information_schema.TABLES but only tables (and not views) in information_schema.VIEWS. Looking at the code, the view transformation is indeed defined as:
{code:sql}select vdbname, schemaName, name, 'NONE', case when SupportsUpdates then 'YES' else 'NO' end from sys.tables where IsPhysical{code}.
Is there any reason why it is implemented or is it maybe a bug? :)
> Add support for information_schema namespace
> --------------------------------------------
>
> Key: TEIID-5220
> URL: https://issues.jboss.org/browse/TEIID-5220
> Project: Teiid
> Issue Type: Bug
> Components: ODBC, Query Engine
> Reporter: Divyesh Vallabh
> Assignee: Steven Hawkins
> Priority: Major
> Fix For: 10.3, 10.2.1
>
>
> The npgsql provider uses the the infomation_schema namespace to query meta information for tables and views.
> Add support for information_schema.tables (
> https://www.postgresql.org/docs/10/static/infoschema-tables.html) to teiid
> Add support for information_schema.views (
> https://www.postgresql.org/docs/10/static/infoschema-views.html) to teiid
> Add support for information_schema.columns (
> https://www.postgresql.org/docs/10/static/infoschema-columns.html) to teiid
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
5 years, 4 months
[JBoss JIRA] (TEIID-5804) is distinct from results in TEIID30167 could not find symbol
by Bram Gadeyne (Jira)
Bram Gadeyne created TEIID-5804:
-----------------------------------
Summary: is distinct from results in TEIID30167 could not find symbol
Key: TEIID-5804
URL: https://issues.jboss.org/browse/TEIID-5804
Project: Teiid
Issue Type: Bug
Affects Versions: 12.2.1
Reporter: Bram Gadeyne
Assignee: Steven Hawkins
Attachments: not_working.sql, working.sql
An error "Could not find symbol: n.hospadmissiontime" occurs when executing the statement below. I'll add a full sql script because this is executed in a procedure. Running this outside of a procedure does not seem to result in an issue.
SELECT n.*
FROM #tmp_admission_to_update tu
join tmp_newvals n on n.admissionid = tu.patientid
join tmp_oldvals o on o.admissionid = tu.patientid
where tu.in_tbl and
(
n.hospadmissiontime is distinct from o.hospadmissiontime or
n.origin is distinct from o.origin or
n.hospital is distinct from o.hospital or
n.gender is distinct from o.gender or
n.nationality is distinct from o.nationality or
n.postalcode is distinct from o.postalcode or
n.country is distinct from o.country or
n.hospitaldischargetime is distinct from o.hospitaldischargetime or
n.destination is distinct from o.destination or
n.warddischarge is distinct from o.warddischarge or
(n.foto is null and o.foto is not null)
)
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
5 years, 4 months
[JBoss JIRA] (TEIID-5803) Seems to be not possible to POST a new entity via a navigation property to a collection
by Christoph John (Jira)
[ https://issues.jboss.org/browse/TEIID-5803?page=com.atlassian.jira.plugin... ]
Christoph John updated TEIID-5803:
----------------------------------
Description:
Hello Steven,
I am currently trying to post/create an entity in a collection via a relative binding path. Unfortunately, I always get an error saying
{"error":{"code":null,"message":"HTTP method 'POST' not allowed for this resource."}}
I have bound the root view to .../Account(1) from which I have a navigation property to the relevant collection. Currently I have trouble to post to collections via a navigation path.
As far as I understood from
http://docs.oasis-open.org/odata/odata/v4.01/csprd04/part1-protocol/odata...
chapter 11.4.2 this should work according to my tries below.
Might you tell me if my path via the navigation property should work for post requests or what I am doing wrong?
Directly writing to the collection is fine, i.e. something like the following:
curl --user sap:sap -i -X POST -H 'Content-Type: application/json;charset=UTF-8;IEEE754Compatible=true' -d '{"fkProfile":"1","idCode":null,"lc":"de","product_name":"A Product","brands":"A brand","energy_100g":2259,"carbohydrates_100g":60.08,"sugars_100g":10.1,"proteins_100g":24.03,"fat_100g":15.89,"saturated_fat_100g":10.0,"salt_100g":1.0}' http://localhost:18080/odata4/svc/my_nutri_diary/UserDefinedProducts
and a GET request via a navigation property path (given below) also works, but a path via a navigation property does not work when using the path in a POST request. I.e. when going via the navigation property. Example:
curl --user sap:sap -i -X POST -H 'Content-Type: application/json;charset=UTF-8;IEEE754Compatible=true' -d '{"fkProfile":"1","idCode":null,"lc":"de","product_name":"A Product","brands":"A brand","energy_100g":2259,"carbohydrates_100g":60.08,"sugars_100g":10.1,"proteins_100g":24.03,"fat_100g":15.89,"saturated_fat_100g":10.0,"salt_100g":1.0}' http://localhost:18080/odata4/svc/my_nutri_diary/Account\(1\)/UserDefined...
Here you find the backend metadata. They show that UserDefinedProducts_fKUserDefinedProductToAccount is simply a navigaton path from Account(xxx) to the UserDefinedProducts collection.
https://ecubed-solutions.ddnss.de/odata4/svc/my_nutri_diary/$metadata
user: sap
password: sap
Thanks a lot for your help!
Note: I am currently trying to add data via a navigation property path because my frontend library sapui5 only caches and syncs data queried via a single context binding. Hence, to be consistent via all views in my app which bind to the odata model, I need to use only one absolute binding and have to query/update other contexts via relative binding paths from this single absolute path, to allow for all frontend views to maintain data consistency
was:
Hello Steven,
I am currently trying to post/create an entity into a collection via a relative binding. Unfortunately, I always get an error saying
{"error":{"code":null,"message":"HTTP method 'POST' not allowed for this resource."}}
I have bound the root view to .../Account(1) from which I have a navigation property to the relevant collection. Currently I have trouble to post to collections via a navigation path.
Might you tell me if my path via the navigation property should work for post requests?
Directly writing to the collection is fine, i.e. something like the following:
curl --user sap:sap -i -X POST -H 'Content-Type: application/json;charset=UTF-8;IEEE754Compatible=true' -d '{"fkProfile":"1","idCode":null,"lc":"de","product_name":"A Product","brands":"A brand","energy_100g":2259,"carbohydrates_100g":60.08,"sugars_100g":10.1,"proteins_100g":24.03,"fat_100g":15.89,"saturated_fat_100g":10.0,"salt_100g":1.0}' http://localhost:18080/odata4/svc/my_nutri_diary/UserDefinedProducts
and a GET request via the following navigation property path also works, but not when using the path in a POST request. I.e. when going via the navigation property via
curl --user sap:sap -i -X POST -H 'Content-Type: application/json;charset=UTF-8;IEEE754Compatible=true' -d '{"fkProfile":"1","idCode":null,"lc":"de","product_name":"A Product","brands":"A brand","energy_100g":2259,"carbohydrates_100g":60.08,"sugars_100g":10.1,"proteins_100g":24.03,"fat_100g":15.89,"saturated_fat_100g":10.0,"salt_100g":1.0}' http://localhost:18080/odata4/svc/my_nutri_diary/Account\(1\)/UserDefined...
it does not work.
Here you find the backend metadata:
https://ecubed-solutions.ddnss.de/odata4/svc/my_nutri_diary/$metadata
user: sap
password: sap
Thanks a lot for your help!
Note: I am currently trying to add data via a navigation property path as my frontend library sapui5 caches and syncs data in a single context binding only. Hence, to be consistent via all application views which bind to the model I just want to use one one absolute binding and relative data bindings from there to allow all frontend views to maintain data consistency
> Seems to be not possible to POST a new entity via a navigation property to a collection
> ---------------------------------------------------------------------------------------
>
> Key: TEIID-5803
> URL: https://issues.jboss.org/browse/TEIID-5803
> Project: Teiid
> Issue Type: Bug
> Reporter: Christoph John
> Assignee: Steven Hawkins
> Priority: Major
>
> Hello Steven,
> I am currently trying to post/create an entity in a collection via a relative binding path. Unfortunately, I always get an error saying
> {"error":{"code":null,"message":"HTTP method 'POST' not allowed for this resource."}}
> I have bound the root view to .../Account(1) from which I have a navigation property to the relevant collection. Currently I have trouble to post to collections via a navigation path.
> As far as I understood from
> http://docs.oasis-open.org/odata/odata/v4.01/csprd04/part1-protocol/odata...
> chapter 11.4.2 this should work according to my tries below.
> Might you tell me if my path via the navigation property should work for post requests or what I am doing wrong?
> Directly writing to the collection is fine, i.e. something like the following:
> curl --user sap:sap -i -X POST -H 'Content-Type: application/json;charset=UTF-8;IEEE754Compatible=true' -d '{"fkProfile":"1","idCode":null,"lc":"de","product_name":"A Product","brands":"A brand","energy_100g":2259,"carbohydrates_100g":60.08,"sugars_100g":10.1,"proteins_100g":24.03,"fat_100g":15.89,"saturated_fat_100g":10.0,"salt_100g":1.0}' http://localhost:18080/odata4/svc/my_nutri_diary/UserDefinedProducts
> and a GET request via a navigation property path (given below) also works, but a path via a navigation property does not work when using the path in a POST request. I.e. when going via the navigation property. Example:
> curl --user sap:sap -i -X POST -H 'Content-Type: application/json;charset=UTF-8;IEEE754Compatible=true' -d '{"fkProfile":"1","idCode":null,"lc":"de","product_name":"A Product","brands":"A brand","energy_100g":2259,"carbohydrates_100g":60.08,"sugars_100g":10.1,"proteins_100g":24.03,"fat_100g":15.89,"saturated_fat_100g":10.0,"salt_100g":1.0}' http://localhost:18080/odata4/svc/my_nutri_diary/Account\(1\)/UserDefined...
> Here you find the backend metadata. They show that UserDefinedProducts_fKUserDefinedProductToAccount is simply a navigaton path from Account(xxx) to the UserDefinedProducts collection.
> https://ecubed-solutions.ddnss.de/odata4/svc/my_nutri_diary/$metadata
> user: sap
> password: sap
> Thanks a lot for your help!
> Note: I am currently trying to add data via a navigation property path because my frontend library sapui5 only caches and syncs data queried via a single context binding. Hence, to be consistent via all views in my app which bind to the odata model, I need to use only one absolute binding and have to query/update other contexts via relative binding paths from this single absolute path, to allow for all frontend views to maintain data consistency
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
5 years, 4 months
[JBoss JIRA] (TEIIDSB-113) Update Teiid OpenShift Examples based on Operator
by Ramesh Reddy (Jira)
Ramesh Reddy created TEIIDSB-113:
------------------------------------
Summary: Update Teiid OpenShift Examples based on Operator
Key: TEIIDSB-113
URL: https://issues.jboss.org/browse/TEIIDSB-113
Project: Teiid Spring Boot
Issue Type: Task
Components: examples
Reporter: Ramesh Reddy
Fix For: 1.2.0
Based on the work from the Operator the `openshift-examples` can be updated to take the Operator model. This will also expose any gaps in the Operator offering.
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
5 years, 4 months
[JBoss JIRA] (TEIID-5803) Seems to be not possible to POST a new entity via a navigation property to a collection
by Christoph John (Jira)
Christoph John created TEIID-5803:
-------------------------------------
Summary: Seems to be not possible to POST a new entity via a navigation property to a collection
Key: TEIID-5803
URL: https://issues.jboss.org/browse/TEIID-5803
Project: Teiid
Issue Type: Bug
Reporter: Christoph John
Assignee: Steven Hawkins
Hello Steven,
I am currently trying to post/create an entity into a collection via a relative binding. Unfortunately, I always get an error saying
{"error":{"code":null,"message":"HTTP method 'POST' not allowed for this resource."}}
I have bound the root view to .../Account(1) from which I have a navigation property to the relevant collection. Currently I have trouble to post to collections via a navigation path.
Might you tell me if my path via the navigation property should work for post requests?
Directly writing to the collection is fine, i.e. something like the following:
curl --user sap:sap -i -X POST -H 'Content-Type: application/json;charset=UTF-8;IEEE754Compatible=true' -d '{"fkProfile":"1","idCode":null,"lc":"de","product_name":"A Product","brands":"A brand","energy_100g":2259,"carbohydrates_100g":60.08,"sugars_100g":10.1,"proteins_100g":24.03,"fat_100g":15.89,"saturated_fat_100g":10.0,"salt_100g":1.0}' http://localhost:18080/odata4/svc/my_nutri_diary/UserDefinedProducts
and a GET request via the following navigation property path also works, but not when using the path in a POST request. I.e. when going via the navigation property via
curl --user sap:sap -i -X POST -H 'Content-Type: application/json;charset=UTF-8;IEEE754Compatible=true' -d '{"fkProfile":"1","idCode":null,"lc":"de","product_name":"A Product","brands":"A brand","energy_100g":2259,"carbohydrates_100g":60.08,"sugars_100g":10.1,"proteins_100g":24.03,"fat_100g":15.89,"saturated_fat_100g":10.0,"salt_100g":1.0}' http://localhost:18080/odata4/svc/my_nutri_diary/Account\(1\)/UserDefined...
it does not work.
Here you find the backend metadata:
https://ecubed-solutions.ddnss.de/odata4/svc/my_nutri_diary/$metadata
user: sap
password: sap
Thanks a lot for your help!
Note: I am currently trying to add data via a navigation property path as my frontend library sapui5 caches and syncs data in a single context binding only. Hence, to be consistent via all application views which bind to the model I just want to use one one absolute binding and relative data bindings from there to allow all frontend views to maintain data consistency
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
5 years, 4 months