Finding NodeName using SQL Query Analyzer

7 messages Options
Embed this post
Permalink
pkrishnaswami

Finding NodeName using SQL Query Analyzer

Reply Threaded More More options
Print post
Permalink
I want to know if it is possible to query for a particular NodeId in the tables automatically generated by JackRabbit.

We have a customNode where the node name is an Id we generate. Let's call this Node A. Node A has a child which is also a custom Node and this Node has some custom properties we have defined. Lets call this Node B. Node B has a property of type jcr:content.

Is there a way for me to query the database for Node A using a where criteria? Which table should I query against? Is this possible at all.
Guo Du

Re: Finding NodeName using SQL Query Analyzer

Reply Threaded More More options
Print post
Permalink
On Mon, Nov 2, 2009 at 7:57 PM, pkrishna <[hidden email]> wrote:
> Is there a way for me to query the database for Node A using a where
> criteria? Which table should I query against? Is this possible at all.
You may have a look the ddl files in package
org.apache.jackrabbit.core.persistence.db. Different db have different
id implementation.

If you have the id, in theory you could query the node. But it doesn't
make too much sense as the data encoded as binary.

-Guo
Phukan, Anit

Search Index

Reply Threaded More More options
Print post
Permalink
Hi,

Is there a way we can turn the Search Indexing off in Jackrabbit? If so,
which is the configurable parameter and where can we configure that?

Thanks
Anit


-----Original Message-----
From: Guo Du [mailto:[hidden email]]
Sent: Monday, November 02, 2009 12:56 PM
To: [hidden email]
Subject: Re: Finding NodeName using SQL Query Analyzer

On Mon, Nov 2, 2009 at 7:57 PM, pkrishna <[hidden email]>
wrote:
> Is there a way for me to query the database for Node A using a where
> criteria? Which table should I query against? Is this possible at all.
You may have a look the ddl files in package
org.apache.jackrabbit.core.persistence.db. Different db have different
id implementation.

If you have the id, in theory you could query the node. But it doesn't
make too much sense as the data encoded as binary.

-Guo
Alexander Klimetschek

Re: Search Index

Reply Threaded More More options
Print post
Permalink
On Tue, Nov 3, 2009 at 00:49, Phukan, Anit <[hidden email]> wrote:
> Is there a way we can turn the Search Indexing off in Jackrabbit? If so,
> which is the configurable parameter and where can we configure that?

Simply remove the SearchIndex element from the configuration. See
http://jackrabbit.apache.org/jackrabbit-configuration.html

Regards,
Alex

--
Alexander Klimetschek
[hidden email]
Marcel Reutegger

Re: Finding NodeName using SQL Query Analyzer

Reply Threaded More More options
Print post
Permalink
In reply to this post by pkrishnaswami
Hi,

2009/11/2 pkrishna <[hidden email]>:

>
> I want to know if it is possible to query for a particular NodeId in the
> tables automatically generated by JackRabbit.
>
> We have a customNode where the node name is an Id we generate. Let's call
> this Node A. Node A has a child which is also a custom Node and this Node
> has some custom properties we have defined. Lets call this Node B. Node B
> has a property of type jcr:content.
>
> Is there a way for me to query the database for Node A using a where
> criteria? Which table should I query against? Is this possible at all.

you should use the query mechanism defined by JCR.

QueryManager qm = ...
Query q = qm.createQuery("select * from your:type where property =
'value'", Query.SQL);
QueryResult result = q.execute();

I'm not sure I understand your use case. maybe something like this
(using XPath syntax)?

//element(*, type-of-node-A)[*/@jcr:content = 'some-value']

though, jcr:content is usually the name of a child node of a nt:file node.

so you'd rather want to do this?

//element(*, type-of-node-A)[jcr:contains(*/jcr:content, 'foo')]

regards
 marcel

> --
> View this message in context: http://old.nabble.com/Finding-NodeName-using-SQL-Query-Analyzer-tp26157796p26157796.html
> Sent from the Jackrabbit - Users mailing list archive at Nabble.com.
>
>
pkrishnaswami

Re: Finding NodeName using SQL Query Analyzer

Reply Threaded More More options
Print post
Permalink
I guess I was not clear enough on what I wanted; I do use createQuery programmatically to retrieve nodes from the repository. What I was after was for me to examine the existence of a particular node that is stored in repository using SQLDeveloper, for instance. The UUID we generate becomes the node Name. I just want to examine the existence of this node quickly using applications like SQLDeveloper, Aquadata etc. Our repository is an oracle database. I launch SQLDeveloper and traverse to the database. I see tables created by JackRabbit. They are entry-related, version-related, workspace-related. I was looking for a NodeId, for example, in CMSVER_NODE, CMSWKSP_NODE tables that matches the node name I am looking for. Even though, I know for sure such a node exists, I couldn't see it in SQLDeveloper.

Is there a way do this? If so, which table should I be looking at.

Marcel Reutegger wrote:
Hi,

2009/11/2 pkrishna <prabhakar.krishnaswami@ge.com>:
>
> I want to know if it is possible to query for a particular NodeId in the
> tables automatically generated by JackRabbit.
>
> We have a customNode where the node name is an Id we generate. Let's call
> this Node A. Node A has a child which is also a custom Node and this Node
> has some custom properties we have defined. Lets call this Node B. Node B
> has a property of type jcr:content.
>
> Is there a way for me to query the database for Node A using a where
> criteria? Which table should I query against? Is this possible at all.

you should use the query mechanism defined by JCR.

QueryManager qm = ...
Query q = qm.createQuery("select * from your:type where property =
'value'", Query.SQL);
QueryResult result = q.execute();

I'm not sure I understand your use case. maybe something like this
(using XPath syntax)?

//element(*, type-of-node-A)[*/@jcr:content = 'some-value']

though, jcr:content is usually the name of a child node of a nt:file node.

so you'd rather want to do this?

//element(*, type-of-node-A)[jcr:contains(*/jcr:content, 'foo')]

regards
 marcel

> --
> View this message in context: http://old.nabble.com/Finding-NodeName-using-SQL-Query-Analyzer-tp26157796p26157796.html
> Sent from the Jackrabbit - Users mailing list archive at Nabble.com.
>
>
Marcel Reutegger

Re: Finding NodeName using SQL Query Analyzer

Reply Threaded More More options
Print post
Permalink
In reply to this post by Marcel Reutegger
Hi,

On Wed, Nov 4, 2009 at 21:14, pkrishna <[hidden email]> wrote:

>
> I guess I was not clear enough on what I wanted; I do use createQuery
> programmatically to retrieve nodes from the repository. What I was after was
> for me to examine the existence of a particular node that is stored in
> repository using SQLDeveloper, for instance. The UUID we generate becomes
> the node Name. I just want to examine the existence of this node quickly
> using applications like SQLDeveloper, Aquadata etc. Our repository is an
> oracle database. I launch SQLDeveloper and traverse to the database. I see
> tables created by JackRabbit. They are entry-related, version-related,
> workspace-related. I was looking for a NodeId, for example, in CMSVER_NODE,
> CMSWKSP_NODE tables that matches the node name I am looking for. Even
> though, I know for sure such a node exists, I couldn't see it in
> SQLDeveloper.
>
> Is there a way do this? If so, which table should I be looking at.

no, it is not possible to look up a node by name using external SQL
tools. that information is serialized into a binary field in the
database. I suggest you use the regular JCR API.

regards
 marcel

>
> Marcel Reutegger wrote:
>>
>> Hi,
>>
>> 2009/11/2 pkrishna <[hidden email]>:
>>>
>>> I want to know if it is possible to query for a particular NodeId in the
>>> tables automatically generated by JackRabbit.
>>>
>>> We have a customNode where the node name is an Id we generate. Let's call
>>> this Node A. Node A has a child which is also a custom Node and this Node
>>> has some custom properties we have defined. Lets call this Node B. Node B
>>> has a property of type jcr:content.
>>>
>>> Is there a way for me to query the database for Node A using a where
>>> criteria? Which table should I query against? Is this possible at all.
>>
>> you should use the query mechanism defined by JCR.
>>
>> QueryManager qm = ...
>> Query q = qm.createQuery("select * from your:type where property =
>> 'value'", Query.SQL);
>> QueryResult result = q.execute();
>>
>> I'm not sure I understand your use case. maybe something like this
>> (using XPath syntax)?
>>
>> //element(*, type-of-node-A)[*/@jcr:content = 'some-value']
>>
>> though, jcr:content is usually the name of a child node of a nt:file node.
>>
>> so you'd rather want to do this?
>>
>> //element(*, type-of-node-A)[jcr:contains(*/jcr:content, 'foo')]
>>
>> regards
>>  marcel
>>
>>> --
>>> View this message in context:
>>> http://old.nabble.com/Finding-NodeName-using-SQL-Query-Analyzer-tp26157796p26157796.html
>>> Sent from the Jackrabbit - Users mailing list archive at Nabble.com.
>>>
>>>
>>
>>
>
> --
> View this message in context: http://old.nabble.com/Finding-NodeName-using-SQL-Query-Analyzer-tp26157796p26203861.html
> Sent from the Jackrabbit - Users mailing list archive at Nabble.com.
>
>