odata

Authorization Using Olingo and JPA

て烟熏妆下的殇ゞ 提交于 2020-07-05 17:19:46
问题 I'm using JPA and Olingo for some REST services. I was able to get the basic implementation working with my entities similar to the example here: JPA Olingo Web App. However Now I'm trying to add authorization where I join to access tables and then filter the results accordingly. I'm just wondering if there is a good way of doing this without having to override default behavior. I have seen the annotation processor here Annotation Processor for EDM but it doesn't seem to fit our model very

Authorization Using Olingo and JPA

南楼画角 提交于 2020-07-05 17:18:14
问题 I'm using JPA and Olingo for some REST services. I was able to get the basic implementation working with my entities similar to the example here: JPA Olingo Web App. However Now I'm trying to add authorization where I join to access tables and then filter the results accordingly. I'm just wondering if there is a good way of doing this without having to override default behavior. I have seen the annotation processor here Annotation Processor for EDM but it doesn't seem to fit our model very

Is there support for paging with OData in Cosmos DB?

爱⌒轻易说出口 提交于 2020-07-03 05:21:09
问题 I can see there is support for offset/limit when accessing a Cosmos DB in Azure via the SQL API - but does OData support this yet? 回答1: UPDATE You can download my demo in github. And this article and offical document can help u. Data in My Storage account Test by postman TestDataController.cs public class TestDataController : ODataController { [EnableQuery] public IHttpActionResult Get() { CloudStorageAccount account = CloudStorageAccount.Parse("DefaultEndpointsProtocol=***x=core.windows.net"

Authorization using Apache Olingo V2 / JPA

允我心安 提交于 2020-06-28 06:26:07
问题 I am trying to implement a custom authorization scheme for an OData2 server which is exposed using the Apache Olingo JPA annotation processor; the authorization involves a basic user:operation pair to restrict query/update/insert/delete operations on the database; the idea is to secure the server layer (Tomcat) via username/password, and then propagating the user id to the OData layer to perform the permission check. Has anyone implemented something similar? My current approach involves

Jpa/Hibernate Odata $filter query fails in 2.0.10

梦想与她 提交于 2020-06-28 03:43:11
问题 I have implemented in my spring boot project olingo-odata2 library . When I try this query in olingo-odata2 version 2.0.7 /api/v1/reports/Users?$filter=startswith(Description,'a') eq true it works fine but in this version I cannot filtering in expanded property. when I try the query in version 2.0.10 I get this error: Query: `SELECT E1 FROM User E1 WHERE (E1.description LIKE CONCAT(?2,'%') ESCAPE '\' ) ORDER BY E1.id You have an error in your SQL syntax; check the manual that corresponds to

How to address entity that uses composite identity key in OData Url?

流过昼夜 提交于 2020-06-27 07:08:21
问题 I have an entity OrderItem that has OrderId and ProductId integer fields and these two fields form the identity key/primary key for this table. I would like to use OData/Web API to expose such entities through a service and to be able to select OrderItem instances by they composite ID . What should be the format of the URL ? Are there any best practices for handling such scenarios? 回答1: Composite keys in the URL use syntax like this: ~/OrderItems(OrderId=1234,ProductId=1234) The "grammar" is

How to get only Odata.Count without value

自作多情 提交于 2020-06-27 06:50:12
问题 Is there any way I can get only count of the data in response payload without any value array? I am using ODataV4.0 with Webapi 2.2. Currently it returns all the values and count when I query something like: http://odata/People?$count=true I just need something like "@odata.count":1, "value":[] or without "value" . Is the only way to have function for this job? 回答1: Set the $top to zero and $count to true. For example: http://services.odata.org/V4/Northwind/Northwind.svc/Customers?$count=true

using the $filter inside the $expand in the Odata query

梦想的初衷 提交于 2020-06-16 07:22:05
问题 I am trying to use the filter in the expanded entity using the Odata query like https://labstest.science.com/DEV/odata/ROOM_REQUEST?$expand=REQ_COLONYROOM($select=Name;$filter=Name eq 'RB05') This works partially. It brings all the ROOM_REQUEST with Null for the REQ_COLONYROOM where Name is not equal to RB05 { "@odata.context": "https://labstest.science.com/DEV/odata/$metadata#ROOM_REQUEST(REQ_COLONYROOM(Name))", "value": [ { "Id": 18399308, "Name": "M1", "Barcode": "M1", "REQ_COLONYROOM":

Why does this OData query with $count=true return an object?

时光毁灭记忆、已成空白 提交于 2020-05-31 06:18:13
问题 I am trying to figure out how to correctly support returning the number of items in a (filtered) data set in my OData API. My understanding is that adding the $count=true argument to the query string should allow for this. Now, based on the example from the tutorial in the official docs, adding that parameter should cause the web API to return just an integer number: The request below returns the total number of people in the collection. GET serviceRoot/People?$count=true Response Payload 20

Swagger crashes with circular model references

五迷三道 提交于 2020-05-30 03:42:17
问题 I have a .Net Core 2.2 OData API, for which I'm tying to implement Swagger documentation. I've been following this example: https://github.com/Microsoft/aspnet-api-versioning/tree/master/samples/aspnetcore/SwaggerODataSample I've got it working up to a point. Now I'm facing an issue with my models referencing each other in a circular manner, let me explain: Note: I used EFCore Code first approach for handling my DB. I have these models (as an example): Project, ProjectLocation, ProjectRegion.