incubator-graffito-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Koci <martin.k...@aura.cz>
Subject [jcr-mapping] Bug in org.apache.portals.graffito.jcr.persistence.atomictypeconverter.impl.UtilDateTypeConverterImpl
Date Tue, 08 Nov 2005 10:20:42 GMT
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.

-- 
Mgr. Martin Kočí
---------------------------------
AURA, s.r.o.
Úvoz 499/56; 602 00 Brno
ISO 9001 certifikovaná společnost
tel./fax: +420 5 43 24 51 11
e-mail:  martin.koci@aura.cz
internet: http://www.aura.cz
         http://www.j2ee.cz
--------------------------------- 


Mime
View raw message