Hi Aurélien,

2013/8/16 Aurélien Manteaux <[email protected]>

> Hi Lukas,
>
> Thanks for your reply.
>
> The problem with forcedType is that it maps SQL columns with a Java type.
> That means every time I create a column with a tinyint(1) type, I have to
> add this column in the forced type.
> I would like to tell jOOQ "I know what I am doing, always map tinyint with
> boolean whatever the column name".
>

True. Often, booleans can be recognised through naming convention. E.g.
- IS_ prefix
- HAS_ prefix
- DELETED suffix
- VISIBLE suffix
- ACTIVE suffix

Of course, such heuristics may not be entirely reliable. Adding support for
type-matching (in addition or instead of name-matching) is on the roadmap:
https://github.com/jOOQ/jOOQ/issues/2352

In my case I will round the problem since I am overriding the JavaGenerator
> anyway.
>
> Does a feature request on this will be accepted ? If so, I can do the work
> if you want (after I finished the cache layer :)
>

I'm not sure what changes will be needed. I suspect that TINYINT(1) is not
really a MySQL data type, as (1) is only used for visual purposes and has
no formal semantics. For instance, the
INFORMATION_SCHEMA.COLUMNS.NUMERIC_PRECISION value is 3.

In that sense, it might be better to use CHAR(1) for MySQL booleans.

-- 
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/groups/opt_out.

Reply via email to