Unsigned JdbcType is resolved to only signed JavaType , which won't it overflow?
2018-01-13 14:47
609 查看
Unsigned JdbcType is resolved to only signed JavaType , which won't it overflow? #314
51Bigod opened this issue 2 days ago · 3 comments
Comments
51Bigod commented 2
days ago
For Example , SMALLINT is resolved to Short , The scope of the Short is -32768 ~ 32767, The scope of the Signed SMALLINT is also -32768 ~ 32767, but The scope of the Unsigned SMALLINT is also 0 ~ 65535, which won't it overflow? |
51Bigod commented 2
days ago •
edited Thank you for your contribution , I think I've got the answer by The MBG documentsMySql supports both signed, and unsigned, numeric fields. These are not JDBC types, so MyBatis generator cannot automatically account for these types of fields. The Java data types are always signed. This can lead to a loss of precision when using unsigned fields. The solution is to provide a <columnOverride> for any unsigned numeric field in MySql |
Owner
jeffgbutler commented a
day ago
This is how MySql works. You'll need to do the <columnOverride> |
http://www.mybatis.org/generator/usage/mysql.html href="https://github.com/mybatis/generator/issues/314#event-1421108742" target=_blank>
51Bigod commented a
minute ago
I see , Thanks for your help |
相关文章推荐
- The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files
- The type java.lang.Object cannot be resolved It is indirectly referenced ... .
- The type java.lang.CharSequence cannot be resolved. It is indirectly referenced from required .class
- The type java.util.Map$Entry cannot be resolved. It is indirectly referenced from required .class fi
- The type java.io.ObjectInputStream cannot be resolved. It is indirectly referenced from required
- The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files
- The type java.util.Map$Entry cannot be resolved. It is indirectly referenced from required .class fi
- The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files
- The type java.io.ObjectInputStream cannot be resolved. It is indirectly referenced from required .cl
- The type java.lang.CharSequence cannot be resolved. It is indirectly referenced from required .class
- The type java.lang.Object cannot be resolved It is indirectly referenced ...
- The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files
- 【web项目】—the type java.io.ObjectInputStream cannot be resolved. It is indirectly referenced from ....
- android Multiple markers at this line - The type java.lang.Class cannot be resolved. It is indirectl
- The type java.lang.CharSequence cannot be resolved. It is indirectly referenced
- eclipse中java文件报错:The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files
- The type java.lang.Object cannot be resolved.It is indirectly referenced from required .class file
- The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files
- The type java.lang.AutoCloseable cannot be resolved. It is indirectly referenced from required
- 出现error:The type java.lang.Object cannot be resolved. It is indirectly referenced from required .cla