cancel
Showing results for 
Search instead for 
Did you mean: 

Expose a collection from a xsodata service

0 Kudos

Hi

I have created a xsodata service "preferences" which exposes the table columns .

service {

"SCHEMA_NAME"."package_path::TABLE_NAME" as "preferences";

}

The table columns are

KEY      VALUE      ITEM_TYPE

a            1               apple

b            2               apple         

x            8               apple

c            3               orange    

d            4               orange

e            9               orange

Is it possible to expose a certain set of collection from the xsodata service "preferences", as lets say, preferences.xsodata/apple and preferences.xsodata/orange. How do you define such a service in the xsodata file?

I have referred the developer guide. The OSDL syntax doesnt give any clue about exposing a certain set of items/rows from the table.

Appreciate your help.

Thanks,

Ponraj

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Ponraj,

You cannot define this in .xsodata file. However, after you expose the OData service, you can consume it using the parameter $filter


Apple: preferences.xsodata/preferences?$filter=ITEM_TYPE eq 'apple'

Orange: preferences.xsodata/preferences?$filter=ITEM_TYPE eq 'orange'

Best regards,

Wenjun