Thanks Jukka!

This is the way I tried and it worked. Upon researching further I also
stumbled upon the xs:dateTime which I need to specify and used your
approach. I wish there was more documentation and samples on XPATH queries
where they would mention how to create the Value.

- Anup

Jukka Zitting wrote:
> 
> Hi,
> 
> On Thu, Apr 24, 2008 at 8:40 PM, AnupChatterjee
> <[EMAIL PROTECTED]> wrote:
>>  I'm trying to query the repository for all the modified nodes under
>> nt:file
>>  changed since a particular TimeStamp
>>
>>  The problem I'm having is with querying with the right format of
>>  lastModified
>>  I have tried the XPATH query -
>>  "//element(*, nt:file)/[EMAIL PROTECTED]:lastModified > " + sqlTimestamp + 
>> "]"
>>
>>  java.sql.TimeStamp.toString as well as getTime() which returns long
>>  millsecs. Any ideas on what the right format is
> 
> The easiest way to get the correct date format is the Value.getString()
> method:
> 
>     Calendar timestamp = ...;
>     Value value = session.getValueFactory().createValue(timestamp);
>     String xpath = "//[EMAIL PROTECTED]:lastModified > xs:dateTime('" +
> value.getString() + "')]";
> 
> BR,
> 
> Jukka Zitting
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Querying-for-all-modified-nodes-based-on-jcr%3AlastModified-tp16851289p16898162.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.

Reply via email to