2016-12-24 0:27 GMT+01:00 Samir Faci <[email protected]>: > Some of those methods are available off the field name as well. I'm not > sure about the year/month but you could probably do something like >
year/month aren't available from the Field reference. Having this OO-style, post-fix notation was an early design mistake, which is not deprecated in the API yet, because it is very widely adopted and it was in there from very early days. One big drawback of the "post-fix" notation is that Java doesn't support something similar to "partial" methods, i.e. a method that is only available on e.g. Field<? extends java.util.Date | java.time.Temporal> but not on Field<? extends Number>, so there's no type safety at all anymore for "post-fix" functions. They just "work" (compile) on any Field<?>. "Prefix" functions (those in DSL) are generic methods that can introduce a new generic type constraint, so these type checks are possible again. Well, if only Java supported union types in generics, not just intersection types :-/ Eventually, we'll generally prefer the SQL style of applying actual functions to expressions, not "methods" to "objects". Hope this helps, Lukas -- 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.
