You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by rainer <Ra...@gmx.de> on 2007/04/12 11:12:24 UTC

JCR only returns handles??

Hi, 

i want to find a node, that contains e.g. "controlType : link" and from this
node i want to get the name nodeData...
("name" and "controlType" are nodeDatas under the same node)

i tried it that way: 

SELECT name FROM nt:base WHERE controlType LIKE 'link'

but it only returns handles like:
"/modules/templating/dialogs/fs/presentLink/tab"

i even can do this: 

SELECT abcdefghijk FROM nt:base WHERE controlType LIKE 'link' 

and get the same results as mentioned above... so what am i doing wrong? Is
there always the "*" nevertheless what i write - or do i have the wrong
"Result Item Type" ?

thx for any help

 
-- 
View this message in context: http://www.nabble.com/JCR-only-returns-handles---tf3564315.html#a9955736
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.


Re: JCR only returns handles??

Posted by David Nuescheler <da...@gmail.com>.
Hi Rainer,

you can access the "name" property via the
QueryResult.getNodes() method and then use
.getProperty("name") on the nodes.

Since Jackrabbit supports querying of residual and
"undefined" properties and also supports the nodetype
inheritance on query you can use properties
in the "where clause" that are not explicitely defined
in the nodetype that you are using in the "from clause".

Not every node returned by your query
must contain a "name"-property since it is not
specified in nt:base, even if they match your filter
criteria of controlType='link'.

If you are using a nodetype that specifies the
property "name" explicitely in its definition, you can
use something like:

[myapp:Control]
- name
- controlType


SELECT name FROM myapp:Control WHERE controlType LIKE 'link'

(Is there a reason for using "LIKE" without a joker instead of "="?)

regards,
david

On 4/12/07, rainer <Ra...@gmx.de> wrote:
>
> Hi,
>
> i want to find a node, that contains e.g. "controlType : link" and from this
> node i want to get the name nodeData...
> ("name" and "controlType" are nodeDatas under the same node)
>
> i tried it that way:
>
> SELECT name FROM nt:base WHERE controlType LIKE 'link'
>
> but it only returns handles like:
> "/modules/templating/dialogs/fs/presentLink/tab"
>
> i even can do this:
>
> SELECT abcdefghijk FROM nt:base WHERE controlType LIKE 'link'
>
> and get the same results as mentioned above... so what am i doing wrong? Is
> there always the "*" nevertheless what i write - or do i have the wrong
> "Result Item Type" ?
>
> thx for any help
>
>
> --
> View this message in context: http://www.nabble.com/JCR-only-returns-handles---tf3564315.html#a9955736
> Sent from the Jackrabbit - Users mailing list archive at Nabble.com.
>
>