Spring Boot JPA 为数据表列 Column 添加注释
Spring Boot JPA About 380 words需求
给列添加注释。
方法一
使用@Column中的columnDefinition。
方法二(推荐)
使用Hibernate提供的@Comment注解。
版本要求:hibernate 5.6.0,Spring Boot 2.6之后的JPA。
@Entity
@Table(name = "user")
public class User {
@Column(length = 50, nullable = false)
private String name;
@Column(name = "nickname")
@Comment("昵称")
private String nickname;
}
参考
Views: 5,536 · Posted: 2023-01-27
———         Thanks for Reading         ———
Give me a Star, Thanks:)
https://github.com/fendoudebb/LiteNote扫描下方二维码关注公众号和小程序↓↓↓
Prev Post
Next Post
Today In History
- Spring Boot OpenFeign 配置 HTTPS 客户端证书 Views: 2,439 · Posted: 2024-04-07
- VSCodium 代替 VS Code Views: 4,184 · Posted: 2023-04-07
- GitHub 提交了生产环境账号密码撤销办法 Views: 2,840 · Posted: 2022-04-07
- Java 中的锁 ReentrantLock Views: 2,870 · Posted: 2021-04-07
- Spring Boot 中的 ApplicationRunner 和 CommandLineRunner Views: 4,606 · Posted: 2020-04-07
- MySQL 命令行纵向打印 Views: 3,642 · Posted: 2019-04-07
- MySQL 存储 IP 地址 Views: 4,260 · Posted: 2019-04-07
- MySQL 字符串拼接 Views: 4,919 · Posted: 2019-04-07
- SQL 删除重复记录且保留一条 Views: 2,966 · Posted: 2019-04-07
- MySQL 查询重复数据 Views: 3,221 · Posted: 2019-04-07
- MySQL 自动更新时间戳及默认时间戳 Views: 6,810 · Posted: 2019-04-07
- MySQL 查询冗余索引 Views: 4,169 · Posted: 2019-04-07
- Ubuntu 系统升级 MySQL 版本 Views: 4,066 · Posted: 2019-04-07
- MySQL 查看运行的是哪份配置文件 Views: 3,821 · Posted: 2019-04-07
- MySQL 严格模式引起的问题 Views: 2,621 · Posted: 2019-04-07
- MySQL 最后一次查询花费时间 Views: 4,229 · Posted: 2019-04-07
- MySQL 查看配置文件路径 Views: 4,586 · Posted: 2019-04-07
- MySQL 时间相差了 13 小时 Views: 3,931 · Posted: 2019-04-07
- MySQL server has gone away Views: 3,917 · Posted: 2019-04-07
- MySQL 存储 Emoji 表情 Views: 2,766 · Posted: 2019-04-07
- MySQL 查看数据储存引擎 Views: 2,543 · Posted: 2019-04-07
- MySQL 查看有多少个连接 Views: 3,375 · Posted: 2019-04-07
- MySQL 数据库设置 root 密码 Views: 2,661 · Posted: 2019-04-07
- MySQL 开启日志 Views: 2,882 · Posted: 2019-04-07
- MySQL 事务 Views: 3,143 · Posted: 2019-04-07
- MySQL 视图 Views: 3,423 · Posted: 2019-04-07
- MySQL 内置函数之时间函数 Views: 3,261 · Posted: 2019-04-07
- MySQL 内置函数之数学函数 Views: 3,271 · Posted: 2019-04-07
- MySQL 内置函数之字符串函数 Views: 3,681 · Posted: 2019-04-07
- MySQL 外键 Views: 3,511 · Posted: 2019-04-07
- MySQL 分页 Views: 2,925 · Posted: 2019-04-07
- MySQL 排序 Views: 2,449 · Posted: 2019-04-07
- MySQL 分组 Views: 3,063 · Posted: 2019-04-07
Browsing
Refresh
Loading...
- CSS var 函数 Views: 2962
- Java synchronized 保证可见性 Views: 2929
- Java 并发编程之 AtomicIntegerFieldUpdater AtomicLongFieldUpdater AtomicReferenceFieldUpdater Views: 2615
- Windows10 关闭子系统提示音 Views: 3836
- Docker 部署 MySQL Views: 3227
- Rust #[no_mangle] 属性 Views: 5245
- Spring Boot MyBatis 将 PostgreSQL jsonb 转为 Jackson 3 JsonNode Views: 437
- Telepresence 设置配置文件更改默认配置 Views: 3579
- MySQL 之 Windows 免安装版本配置环境 Views: 3548
- 为什么匿名内部类引用外部局部变量必须要加 final 关键字 Views: 2280