lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shalin Shekhar Mangar <shalinman...@gmail.com>
Subject Re: DIH DateFormatTransformer ClassCastException
Date Mon, 30 Mar 2009 16:52:00 GMT
On Mon, Mar 30, 2009 at 8:52 PM, Giovanni De Stefano <
giovanni.destefano@gmail.com> wrote:

> Hello all,
>
> I have a little problem with DIH and DateFormatTransformer.
>
> My column in the DB contains an Oracle TIMESTAMP; the corresponding field
> is
> of type date in the Solr schema; I specified a DateFormatTransformer for
> the
> entity; the field definition is as follow:
>
> <field column="WHATEVER" name="whatever"
> dateTimeFormat="yyyy-MM-dd'T'hh:mm:ss'+'SSSS"/>
>
> but I keep getting a ClassCastException...
>
> WARNING: transformer threw error
> java.lang.ClassCastException: java.sql.Date


The jdbc equivalent of an Oracle timestamp is java.sql.Date which is a
sub-class of java.util.Date. DateFormatTransformer is used to convert
strings to a date object. Therefore, if your solr field is of date type, you
don't need to use DateFormatTransformer at all.


-- 
Regards,
Shalin Shekhar Mangar.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message