从春天启动更新时,我们的项目1.5到2.0的类EmbeddedServletContainerAutoConfiguration和
ServerPropertiesAutoConfiguration走了,但我们需要他们拼命。当我在互联网上搜索这些课程时,找不到这些课程的替代品。所以我的问题是:这些类是否已在Spring Boot 2.0中删除?如果没有,他们被搬到哪里了?或者我该如何更换它们?
提前致谢。
每次当我根据 Baeldung ( https://www.baeldung.com/hibernate-many-to-many )的教程尝试向我的实体添加双向关系时,我都会从“逆”中得到一个异常,即“不拥有”关系的一面。我的场景如下:一个“用户”可以在零到 n 个“池”中,一个池可以有零到 n 个“用户”。这些是我的实体类:
水池:
@Data
@Entity
@Table(name = "pool")
public class Pool {
//Id and rest of the attributes omitted.
@ManyToMany
@JoinTable(name = "user_pool", joinColumns = {@JoinColumn(name = "pool_id")}, inverseJoinColumns = {@JoinColumn(name = "user_id")})
private Set<User> users;
}
Run Code Online (Sandbox Code Playgroud)
和用户:
@Data
@Entity
@Table(name = "agamottto_user")
public class User {
//Id and rest of the attributes omitted.
@ManyToMany(mappedBy = "users")
private Set<Pool> pools;
}
Run Code Online (Sandbox Code Playgroud)
这是数据库:
CREATE TABLE IF NOT EXISTS `user_pool` (
`user_pool_id` bigint(20) NOT NULL …Run Code Online (Sandbox Code Playgroud)