Hi there,
I have a problem using GeoServer and GeoTools: On WFS-T Updates, using no
PreparedStatements, date fields are dated back by one day. The problem
source is GeoTools in this case.
What I found out:
- First conversion (String to Date ) is using GMT as timezone (XsDateFormat)
- Second conversion (Date to String) is using the default timezone
(CommonsConverterFactory$SqlDateConverter)
Effect: In my local timezone the date is dated back by one day.
Fixing this would change some rather central code
(CommonsConverterFactory$SqlDateConverter should also use GMT).
Running the tests showed, that this also requires adjustment of
org.geotools.filter.IsEqualsToImpl.
IMHO org.geotools.filter.IsEqualsToImpl is not correct for java.sql.Date
currently. It just calls equals(), which compare the milliseconds value of
java.sql.Date only. I think this is not appropriate for java.sql.Date. A
String comparison (2015-04-13) would be a better approch.
Similar things should be done for several other filters: Less, Greater,
EqualOrGreater, Between etc.. IMHO they all are incorrect for
java.sql.Date, using millisecond comparisons rather the "day" comparison.
However changing this would possibly breaking existing applications. I
would like to know what the core developers think about this. Is anybody
willing to take such a step or is it preferred to leave things as they are
(broken)?
BTW: The actual problem doesnt exists when using prepared statements,
because the second conversion is ommited.
Best regards,
Andreas
------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
_______________________________________________
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users