有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

JavaSpringDataREST并没有保存实体的所有字段

我有以下@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/发送一篇帖子时,只会设置status。有人能帮我吗


共 (1) 个答案

  1. # 1 楼答案

    我觉得你错过了获得地位的机会。你查过了吗