incubator-graffito-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christophe Lombart (JIRA)" <>
Subject [jira] Commented: (GRFT-72) Bug in org.apache.portals.graffito.jcr.persistence.atomictypeconverter.impl.UtilDateTypeConverterImpl
Date Mon, 14 Nov 2005 21:01:31 GMT
    [ ] 

Christophe Lombart commented on GRFT-72:

I'm ok to change if  we find a nice solution for searching correctly on date. Lucene has a
bad support for searching on date. 

FYI, I would like to specify in the mapping file which atomic converter to use like this :

<field-descriptor fieldName="lastModified" jcrName="jcr:lastModified"  atomicConverterClass

Of course, it will be a optional feature. If the attribute "atomicConverterClass" is not specify,
the current code will be used. 

> Bug in org.apache.portals.graffito.jcr.persistence.atomictypeconverter.impl.UtilDateTypeConverterImpl
> -----------------------------------------------------------------------------------------------------
>          Key: GRFT-72
>          URL:
>      Project: Graffito
>         Type: Bug
>   Components: JCR-Mapping
>     Reporter: Martin Koci
>     Assignee: Christophe Lombart
>  Attachments: UtilDateTypeConverterImpl.patch
> In this converter following line is used:
> return this.getValueFactory().createValue(((java.util.Date) propValue).getTime());
> but propValue must be converted to java.util.Calendar, not into long! ValueFactory than
converts to LongValue not DateValue as expected.
> Following code works OK:
> final long timeInMilis = ((java.util.Date) propValue).getTime();
> final Calendar calendar = Calendar.getInstance();
> calendar.setTimeInMillis(timeInMilis);
> return this.getValueFactory().createValue( calendar );
> but I dont know better Date-> Calendar conversion.

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:

View raw message