gpt4 book ai didi

java - Spring data rest 没有保存我实体的所有字段

转载 作者:行者123 更新时间:2023-11-30 10:06:51 25 4
gpt4 key购买 nike

我有以下@Entity:

@Entity
public class Person {
@Id @GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
private String name;
private Date birthDate;
private String status;
private String city;
...
// many more attributes
}

我正在使用 spring 数据 rest 如下:

@RepositoryRestResource(collectionResourceRel = "person", path = "person")
public interface PersonRepositorio extends PagingAndSortingRepository<Person, Long>{

}

当我使用包含 Person 的所有属性的 JSON 将帖子发送到 /api/person/ 时,只有状态未设置。有人可以帮助我吗?

最佳答案

好吧,我认为您缺少状态的获取和设置。你检查了吗?

关于java - Spring data rest 没有保存我实体的所有字段,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54471967/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com