Hi, it seems like you're missing a converter which would convert from the type which is stored in your DB (from it's value (1479365948726)I guess it's a TIMESTAMP) to a type which is used in your POJO (ZonedDateTime).
Please have a look at this article regarding Converters: http://www.jooq.org/doc/2.6/manual/sql-execution/fetching/data-type-conversion/ Let me know if this helped you. W dniu piątek, 18 listopada 2016 09:53:58 UTC+1 użytkownik [email protected] napisał: > > Hi, > > I'm trying to run a simple select like so: > > List<Foo> foos = create.select() > .from(FOO) > .limit(pageable.getPageSize()) > .offset(pageable.getOffset()) > .fetchInto(Foo.class); > > > > I'm getting this error: > > > org.jooq.exception.MappingException: An error ocurred when mapping record to > class Foo > at > org.jooq.impl.DefaultRecordMapper$MutablePOJOMapper.map(DefaultRecordMapper.java:658) > > ... > > Caused by: org.jooq.exception.DataTypeException: Cannot convert from > 1479365948726 (class java.lang.Long) to class java.time.ZonedDateTime > at org.jooq.tools.Convert$ConvertAll.fail(Convert.java:1118) > at org.jooq.tools.Convert$ConvertAll.toDate(Convert.java:1070) > at org.jooq.tools.Convert$ConvertAll.from(Convert.java:789) > at org.jooq.tools.Convert.convert0(Convert.java:316) > at org.jooq.tools.Convert.convert(Convert.java:308) > at org.jooq.tools.Convert.convert(Convert.java:380) > at org.jooq.impl.AbstractRecord.get(AbstractRecord.java:243) > at > org.jooq.impl.DefaultRecordMapper$MutablePOJOMapper.map(DefaultRecordMapper.java:694) > at > org.jooq.impl.DefaultRecordMapper$MutablePOJOMapper.map(DefaultRecordMapper.java:614) > > > I'm using jooq 3.8.6 with a postgresql database. Does anyone have any > ideas why? My Foo.java entity does have some ZonedDateTime fields. I'm > guessing jooq doesn't support these? If that's the case, which date/time > type should I be using? > -- You received this message because you are subscribed to the Google Groups "jOOQ User Group" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
