Hello, I have just run into this issue recently myself. This seems to be a well-known issue with the Scala compiler when it has to infer generics with Java: http://stackoverflow.com/q/18961788/521799
The solution seems to be to explicitly bind the generic type [T] to [java.lang.Long]: isnull[java.lang.Long](t.FIINetBuyVol, 0) That's a bit nasty, but unfortunately, I cannot think of a different workaround right now... Hope this helps, Lukas 2015-05-01 7:40 GMT+02:00 ChengYi Lin <[email protected]>: > Hi, > I got an exception in the following code: > > val result = ctx.select(q.Date, q.Symbol, q.Close, > isnull(t.FIINetBuyVol, 0) as FIINetBuyVol).fetch() > > type mismatch; > found : org.jooq.TableField[prod.tables.records.II3TradeRow,Long] > required: org.jooq.Field[Any] > Note: Long <: Any (and > org.jooq.TableField[prod.tables.records.II3TradeRow,Long] <: > org.jooq.Field[Long]), but Java-defined trait Field is invariant in type T. > You may wish to investigate a wildcard type such as `_ <: Any`. (SLS > 3.2.10)] > > > I have to convert 0 to java.lang.Long. Is there a implict way? > > val result = ctx.select(q.Date, q.Symbol, q.Close, > isnull(t.FIINetBuyVol, java.lang.Long.valueOf(0)) as > FIINetBuyVol).fetch() > > Thanks. > > -- > 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. > -- 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.
