Hi Samir,

While it would be possible to use NOT NULL constraint information from the
database in order to generate primitive types where applicable, this will
cause quite a few issues with generics, in particular with Record[N]<T1,
T2, ..., TN> types. These types define methods like T1 value1() and void
value1(T1), where T1 is always the wrapper type, never the primitive type.

I think there were other reasons too, in the past, why jOOQ's code
generator avoided primitive types in generated API. After all, the Record
will still contain the boxed type, and Record.set(Field<T>, T) still sets
the boxed type as well.

Another reason is that this would only apply to Java primitive types, not
to other types that may equally be NOT NULL (such as String).

I suspect that from an API consistency point of view, primitive type
support would just be a bit too wonky for it to be included in jOOQ.

I hope this helps,
Lukas

2016-07-20 0:41 GMT+02:00 Samir Faci <[email protected]>:

> I didn't see an option for this, but I was wondering if it was possible to
> give preference for primitive data types in the interface that are being
> generated.
>
> ie.  boolean over Boolean, long rather then Long etc.
>
> I like the idea of interface to help ensure the Listing objects we create
> is consistent with the data model but we try to avoid nulls since they
> introduce those tristate use cases that are undefined.
>
>
> ie.  Boolean = { yes, no... uhmm.. maybe? } a lot of times null introduces
> an undefined state that is usually preferred to be avoid to represented as
> an enum rather then boolean.
>
> Is there an option to allow such behavior?
>
>
> --
> Thank you
> Samir Faci
> https://keybase.io/csgeek
>
> --
> 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.

Reply via email to