You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@olingo.apache.org by Prerna Chawla <pr...@gmail.com> on 2014/05/02 08:36:47 UTC

Getting the properties for an ODataEntry

Hi,

I have an OData feed.sample code looks like--

ODataFeed odata_feed=
EntityProvider.readFeed(HttpContentType.APPLICATION_XML,entitycontainer.getEntitySet(entitySetName),content_feed,EntityProviderReadProperties.init().build());

for(ODataEntry odata_entry:odata_feed.getEntries())
{
odata_entry.getProperties();
}


odata_entry.getProperties();  gets all the properties corresponding to an
entry.
For each ODataEntry I want to get only certain properties and not all.Is
there any way to do that?

Thanks
Prerna

Re: Getting the properties for an ODataEntry

Posted by "Klevenz, Stephan" <st...@sap.com>.
Hi Prerna,

Have a look into Javadoc:

http://olingo.apache.org/javadoc/odata2/

You will get the information from Interface EdmEntityType.

Greetings,
Stephan


From: Prerna Chawla <pr...@gmail.com>>
Reply-To: "user@olingo.apache.org<ma...@olingo.apache.org>" <us...@olingo.apache.org>>
Date: Mittwoch, 7. Mai 2014 08:32
To: "user@olingo.apache.org<ma...@olingo.apache.org>" <us...@olingo.apache.org>>
Subject: Re: Getting the properties for an ODataEntry

Hi Stephan,

I have a propertyname as String .I want to check whether that property(Column name) exists in the OData entitySet or not.Is there any direct API for that or we need to get the names of all the properties from an odata entry and then check my string against all the properties of Odata entry?



Thanks
Prerna



On Fri, May 2, 2014 at 1:40 PM, Klevenz, Stephan <st...@sap.com>> wrote:
Yes. All packages or classes having 'edm' in name are about metadata.

Stephan

From: Prerna Chawla <pr...@gmail.com>>
Reply-To: "user@olingo.apache.org<ma...@olingo.apache.org>" <us...@olingo.apache.org>>
Date: Freitag, 2. Mai 2014 10:07
To: "user@olingo.apache.org<ma...@olingo.apache.org>" <us...@olingo.apache.org>>
Subject: Re: Getting the properties for an ODataEntry

Thanks! I have another question.
I came across a method EdmTyped<http://olingo.apache.org/javadoc/odata2/org/apache/olingo/odata2/api/edm/EdmTyped.html> getProperty(String<http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true> name) available in Interface EdmStructuralType.Is this method only for metadata part?

Regards
Prerna


On Fri, May 2, 2014 at 12:53 PM, Klevenz, Stephan <st...@sap.com>> wrote:
Hi Prerna,

$select is your friend. Just construct a feed uri and then add $select query option where you can list properties to be returned by server:

http://…./SomeFeed?$select=prop1,prop2,prop3

Regards,
Stephan

From: Prerna Chawla <pr...@gmail.com>>
Reply-To: "user@olingo.apache.org<ma...@olingo.apache.org>" <us...@olingo.apache.org>>
Date: Freitag, 2. Mai 2014 08:36
To: "user@olingo.apache.org<ma...@olingo.apache.org>" <us...@olingo.apache.org>>
Subject: Getting the properties for an ODataEntry

Hi,

I have an OData feed.sample code looks like--

ODataFeed odata_feed= EntityProvider.readFeed(HttpContentType.APPLICATION_XML,entitycontainer.getEntitySet(entitySetName),content_feed,EntityProviderReadProperties.init().build());

for(ODataEntry odata_entry:odata_feed.getEntries())
{
odata_entry.getProperties();
}


odata_entry.getProperties();  gets all the properties corresponding to an entry.
For each ODataEntry I want to get only certain properties and not all.Is there any way to do that?

Thanks
Prerna



Re: Getting the properties for an ODataEntry

Posted by Prerna Chawla <pr...@gmail.com>.
Hi Stephan,

I have a propertyname as String .I want to check whether that
property(Column name) exists in the OData entitySet or not.Is there any
direct API for that or we need to get the names of all the properties from
an odata entry and then check my string against all the properties of Odata
entry?



Thanks
Prerna



On Fri, May 2, 2014 at 1:40 PM, Klevenz, Stephan <st...@sap.com>wrote:

>  Yes. All packages or classes having 'edm' in name are about metadata.
>
>  Stephan
>
>   From: Prerna Chawla <pr...@gmail.com>
> Reply-To: "user@olingo.apache.org" <us...@olingo.apache.org>
> Date: Freitag, 2. Mai 2014 10:07
> To: "user@olingo.apache.org" <us...@olingo.apache.org>
> Subject: Re: Getting the properties for an ODataEntry
>
>   Thanks! I have another question.
> I came across a method EdmTyped<http://olingo.apache.org/javadoc/odata2/org/apache/olingo/odata2/api/edm/EdmTyped.html>
>  getProperty(String<http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true> name)
> available in Interface EdmStructuralType.Is this method only for metadata
> part?
>
>  Regards
> Prerna
>
>
> On Fri, May 2, 2014 at 12:53 PM, Klevenz, Stephan <stephan.klevenz@sap.com
> > wrote:
>
>>  Hi Prerna,
>>
>>  $select is your friend. Just construct a feed uri and then add $select
>> query option where you can list properties to be returned by server:
>>
>>  http://…./SomeFeed?$select=prop1,prop2,prop3
>>
>>  Regards,
>> Stephan
>>
>>   From: Prerna Chawla <pr...@gmail.com>
>> Reply-To: "user@olingo.apache.org" <us...@olingo.apache.org>
>> Date: Freitag, 2. Mai 2014 08:36
>> To: "user@olingo.apache.org" <us...@olingo.apache.org>
>> Subject: Getting the properties for an ODataEntry
>>
>>    Hi,
>>
>>  I have an OData feed.sample code looks like--
>>
>>  ODataFeed odata_feed=
>> EntityProvider.readFeed(HttpContentType.APPLICATION_XML,entitycontainer.getEntitySet(entitySetName),content_feed,EntityProviderReadProperties.init().build());
>>
>>  for(ODataEntry odata_entry:odata_feed.getEntries())
>> {
>> odata_entry.getProperties();
>>  }
>>
>>
>>  odata_entry.getProperties();  gets all the properties corresponding to
>> an entry.
>>  For each ODataEntry I want to get only certain properties and not
>> all.Is there any way to do that?
>>
>>  Thanks
>> Prerna
>>
>>
>

Re: Getting the properties for an ODataEntry

Posted by "Klevenz, Stephan" <st...@sap.com>.
Yes. All packages or classes having 'edm' in name are about metadata.

Stephan

From: Prerna Chawla <pr...@gmail.com>>
Reply-To: "user@olingo.apache.org<ma...@olingo.apache.org>" <us...@olingo.apache.org>>
Date: Freitag, 2. Mai 2014 10:07
To: "user@olingo.apache.org<ma...@olingo.apache.org>" <us...@olingo.apache.org>>
Subject: Re: Getting the properties for an ODataEntry

Thanks! I have another question.
I came across a method EdmTyped<http://olingo.apache.org/javadoc/odata2/org/apache/olingo/odata2/api/edm/EdmTyped.html> getProperty(String<http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true> name) available in Interface EdmStructuralType.Is this method only for metadata part?

Regards
Prerna


On Fri, May 2, 2014 at 12:53 PM, Klevenz, Stephan <st...@sap.com>> wrote:
Hi Prerna,

$select is your friend. Just construct a feed uri and then add $select query option where you can list properties to be returned by server:

http://…./SomeFeed?$select=prop1,prop2,prop3

Regards,
Stephan

From: Prerna Chawla <pr...@gmail.com>>
Reply-To: "user@olingo.apache.org<ma...@olingo.apache.org>" <us...@olingo.apache.org>>
Date: Freitag, 2. Mai 2014 08:36
To: "user@olingo.apache.org<ma...@olingo.apache.org>" <us...@olingo.apache.org>>
Subject: Getting the properties for an ODataEntry

Hi,

I have an OData feed.sample code looks like--

ODataFeed odata_feed= EntityProvider.readFeed(HttpContentType.APPLICATION_XML,entitycontainer.getEntitySet(entitySetName),content_feed,EntityProviderReadProperties.init().build());

for(ODataEntry odata_entry:odata_feed.getEntries())
{
odata_entry.getProperties();
}


odata_entry.getProperties();  gets all the properties corresponding to an entry.
For each ODataEntry I want to get only certain properties and not all.Is there any way to do that?

Thanks
Prerna


Re: Getting the properties for an ODataEntry

Posted by Prerna Chawla <pr...@gmail.com>.
Thanks! I have another question.
I came across a method
EdmTyped<http://olingo.apache.org/javadoc/odata2/org/apache/olingo/odata2/api/edm/EdmTyped.html>
 getProperty(String<http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true>
name)
available in Interface EdmStructuralType.Is this method only for metadata
part?

Regards
Prerna


On Fri, May 2, 2014 at 12:53 PM, Klevenz, Stephan
<st...@sap.com>wrote:

>  Hi Prerna,
>
>  $select is your friend. Just construct a feed uri and then add $select
> query option where you can list properties to be returned by server:
>
>  http://…./SomeFeed?$select=prop1,prop2,prop3
>
>  Regards,
> Stephan
>
>   From: Prerna Chawla <pr...@gmail.com>
> Reply-To: "user@olingo.apache.org" <us...@olingo.apache.org>
> Date: Freitag, 2. Mai 2014 08:36
> To: "user@olingo.apache.org" <us...@olingo.apache.org>
> Subject: Getting the properties for an ODataEntry
>
>    Hi,
>
>  I have an OData feed.sample code looks like--
>
>  ODataFeed odata_feed=
> EntityProvider.readFeed(HttpContentType.APPLICATION_XML,entitycontainer.getEntitySet(entitySetName),content_feed,EntityProviderReadProperties.init().build());
>
>  for(ODataEntry odata_entry:odata_feed.getEntries())
> {
> odata_entry.getProperties();
>  }
>
>
>  odata_entry.getProperties();  gets all the properties corresponding to
> an entry.
>  For each ODataEntry I want to get only certain properties and not all.Is
> there any way to do that?
>
>  Thanks
> Prerna
>
>

Re: Getting the properties for an ODataEntry

Posted by "Klevenz, Stephan" <st...@sap.com>.
Hi Prerna,

$select is your friend. Just construct a feed uri and then add $select query option where you can list properties to be returned by server:

http://…./SomeFeed?$select=prop1,prop2,prop3

Regards,
Stephan

From: Prerna Chawla <pr...@gmail.com>>
Reply-To: "user@olingo.apache.org<ma...@olingo.apache.org>" <us...@olingo.apache.org>>
Date: Freitag, 2. Mai 2014 08:36
To: "user@olingo.apache.org<ma...@olingo.apache.org>" <us...@olingo.apache.org>>
Subject: Getting the properties for an ODataEntry

Hi,

I have an OData feed.sample code looks like--

ODataFeed odata_feed= EntityProvider.readFeed(HttpContentType.APPLICATION_XML,entitycontainer.getEntitySet(entitySetName),content_feed,EntityProviderReadProperties.init().build());

for(ODataEntry odata_entry:odata_feed.getEntries())
{
odata_entry.getProperties();
}


odata_entry.getProperties();  gets all the properties corresponding to an entry.
For each ODataEntry I want to get only certain properties and not all.Is there any way to do that?

Thanks
Prerna