You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by "Seidel. Robert" <Ro...@aeb.de> on 2011/02/23 15:12:01 UTC

Row (Queryresult) vs. Multivalue properties

Hi,

I'm missing a public Value[] getValues(String columnName) method at the row interface. To get the values from a multivalue property I have to go over the node, get the property and cann then access the values.

Is this work as intended or were the multi value properties simply not considered when designing the Row interface?

Regards, Robert

p.s. getValue(String columnName) returns a concatenated string (with spaces) -> this doesn't help me


Re: Row (Queryresult) vs. Multivalue properties

Posted by ttemprano <tt...@Toyota.com.ve>.
I would like to know this as well.

The 
http://www.day.com/maven/javax.jcr/javadocs/jcr-2.0/javax/jcr/query/Row.html#getValue(java.lang.String)
API  does not say anything about this...
-- 
View this message in context: http://jackrabbit.510166.n4.nabble.com/Row-Queryresult-vs-Multivalue-properties-tp3321049p3321113.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.

Re: Row (Queryresult) vs. Multivalue properties

Posted by Alexander Klimetschek <ak...@adobe.com>.
On 23.02.11 15:12, "Seidel. Robert" <Ro...@aeb.de> wrote:
>I'm missing a public Value[] getValues(String columnName) method at the
>row interface. To get the values from a multivalue property I have to go
>over the node, get the property and cann then access the values.
>
>Is this work as intended or were the multi value properties simply not
>considered when designing the Row interface?

IIUC, the row interface was designed for a simpler SQL-like result, which
only knows single-values (simpler because you don't have to "worry" about
the Node interface). It basically just wraps Nodes in a simpler way. This
makes sense for Xpath and SQL-1 queries, where you'd typically use the
getNodes() NodeIterator with Xpath and getRows() with SQL.

Thus one could think that getNodes() is "superior", however, practically,
there are some virtual results, such as the jackrabbit-specific
"rep:excerpt", which you will only find in the row-based results. Also,
with JCR 2.0 and SQL-2, you can have multiple subresults based on the
selectors, and you can only read them out via the Rows
(getNode(selectorName)).

Hence for full feature completeness you'd get the rows, and get the
underlying Node via getNode()/getNode(selector), if your queries require
access to both.

HTH,
Alex

-- 
Alexander Klimetschek
Developer // Adobe (Day) // Berlin - Basel