-
2026-01-17 10:12:20
-
2026-01-17 10:17:02
- 如何在 Spring Boot 中向实体集合添加新条目
- 在SpringBoot+JPA/Hibernate环境中,直接对@OneToMany映射的List调用add()会失败(因底层是PersistentBag),正确做法是使用可变集合类型(如MutableList或ArrayList)并配置双向关系,或通过新建子实体并显式关联父实体来实现安全持久化。
-
102
-
2026-01-17 10:28:29
-
2026-01-17 10:38:02
-
2026-01-17 10:46:05
-
2026-01-17 10:59:23
-
2026-01-17 11:07:10
-
2026-01-17 11:10:15
-
2026-01-17 11:15:20
-
2026-01-17 11:23:33