java - SQLite 64bit integers recognized as ints in jooq -
I have a SQLite database that I am using with jOOQ when I use jOOQ's code generation tool , It creates all tables and records squares as expected, however, all solitites change in the INTEGER column in the generated code in the
java.lang.Integer field.
The problem is that SQLite
INTEGER's can store up to a 64 bit signed integer, where
java.lang.Integer is only a 32 bit signature Is integer.
Could it tell jOOQ to use
java.lang.Long (which is 64 bit signed) for these columns?
In fact, there is no real INTEGER in the form of data type in SQLite Is only one, which can actually store up to 64 bit signed entries. However, when you use DDL, you will usually use one of the (most) standard "type name", which is used for CREATE TABLE statement and CAST Expressions can be done in:
- INT
- INTEGER
- Tinnit
- Muhammad
- MidiMiniti
-
-
-
-
- INT2
- INT8
generate a java To get jOOQ for Lang.Long , you must enter BIGINT or in your CREATE TABLE statement. NT8 if you use INT or INTEGER , you can assume that in fact 32 bit signed entries are stored , And thus java.lang.Integer value.
Rewriting data types Note that the ZyOu Code Generator configuration allows you to:
and lieutenant; ForcedType & gt; & Lt ;! - specify any data type from org.jooq.impl.SQLDataType - & gt; & Lt; Name & gt; BIGINT & lt; / Name & gt; & Lt ;! - Add a Java regular expression that matches the fully qualified column. Use the pipe (union operator) to separate many expressions. If provided, both "expression" and "type" should match. - & gt; & Lt; Expression & gt; * \ IS_VALID & lt; / Expression & gt; & Lt ;! To add compatibility to this type, adding the data type that matches a Java regular expression should be matched if both "expression" and "type" match. - & gt; & Lt; Type & gt; * & Lt; / Type & gt; & Lt; / ForcedType & gt;
Comments
Post a Comment