You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Frédéric Esnault <fe...@legisway.com> on 2007/06/12 15:51:49 UTC

Query - Row - multivalued properties

Hi all !

 

I'm wondering, when using a RowIterator on a query retrieving properties (//element(*, ns:mytype)/@ns:myprop).

The getColumnNames() and getValue() association works correctly, but fails when dealing with a multivalued property.

How are we supposed to get the property values?

 

The Row interface proposes the methods :

getValues() : returns all the values;

getValue(String prop_name) : return the value of the property name given as a parameter.

 

Shouldn't it propose another method :

getValues(String prop_name), returning the values of the multivalued property given as a parameter.

 

As for now, I don't now how to get my multivalued props values...Jackrabbit doesn't like multivalued properties, it seems...

 

Frederic Esnault           


RE: Query - Row - multivalued properties

Posted by Frédéric Esnault <fe...@legisway.com>.
Thanks, I figured out we had to use the node (saw a post in a mailing list from Jukka Zitting). What surprises me is that JSR 170 does not allow the getValues(String propName) mechanism. It's quite heavy imo to get one of the property, get the associated node then get the property values.

No plan to change this? Am I alone to think this is strange and/or heavy?

Frédéric Esnault - Ingénieur R&D


-----Message d'origine-----
De : Marcel Reutegger [mailto:marcel.reutegger@gmx.net] 
Envoyé : mercredi 13 juin 2007 09:18
À : users@jackrabbit.apache.org
Objet : Re: Query - Row - multivalued properties

Frédéric Esnault wrote:
> How are we supposed to get the property values?

you need to get the node either through the NodeIterator on the QueryResult or 
using the jcr:path column and then retrieve the node using the session. once you 
have the node use node.getProperty(propName).getValues()

> The Row interface proposes the methods :
> getValues() : returns all the values;
> getValue(String prop_name) : return the value of the property name given as a
> parameter.

this is not jackrabbit specific but defined in the jsr 170 specification.

regards
  marcel

Re: Query - Row - multivalued properties

Posted by Marcel Reutegger <ma...@gmx.net>.
Frédéric Esnault wrote:
> I'm wondering, when using a RowIterator on a query retrieving properties
> (//element(*, ns:mytype)/@ns:myprop).
> 
> The getColumnNames() and getValue() association works correctly, but fails
> when dealing with a multivalued property.
> 
> How are we supposed to get the property values?

you need to get the node either through the NodeIterator on the QueryResult or 
using the jcr:path column and then retrieve the node using the session. once you 
have the node use node.getProperty(propName).getValues()

> The Row interface proposes the methods :
> 
> getValues() : returns all the values;
> 
> getValue(String prop_name) : return the value of the property name given as a
> parameter.
> 
> Shouldn't it propose another method :
> 
> getValues(String prop_name), returning the values of the multivalued property
> given as a parameter.
> 
> As for now, I don't now how to get my multivalued props values...Jackrabbit
> doesn't like multivalued properties, it seems...

this is not jackrabbit specific but defined in the jsr 170 specification.

regards
  marcel