mysql - What Java datatype can I use for MY SQL TinyInt
问题描述
I am confused with this documentation https://dev.mysql.com/doc/connector-j/5.1/en/connector-j-reference-type-conversions.html
TINYINT java.lang.Boolean if the configuration property tinyInt1isBit is set to true (the default) and the storage size is 1, or java.lang.Integer if not.
I have this in entity class
@Column(columnDefinition = "TINYINT default 0")
private boolean tcheck;
I see this in DB
tcheck TINYINT default 0,
The numeric precision column is 3.
I think this means storage is 3 ?
Can I change private boolean tcheck; ===> to ===> java.lang.Integer?
I use flyway, so dont want to risk application start/corrupt db (or) updates to column width.[as size 3 is good enough]
I am assuming that changing to java.lang.Integer will not require update DB column. IS this correct?
please advice
解决方案
推荐阅读
- db2 - 如何在不等待的情况下锁定 DB2 中的表
- c# - 将视图模型集合绑定到 WPF MVVM TabControl
- neo4j - 在 NEO4J 中导入 csv 时出错
- mapbox-gl-js - 在“填充”类型的 mapbox gl js 层中:我们可以控制笔画粗细吗?
- java - Eclipse 对可访问代码给出死代码警告
- python - 将多个 csv 文件读入 Pandas 数据框
- python - 从 mongo db 游标的嵌套数据中构建 pandas 数据框
- javascript - Webpack - worker importScripts 的单独捆绑包
- java - 如何使用java程序执行oraenv脚本?
- azure - 流分析 - 将传入的 JSON 转换为 PowerBI 流数据集