@Transient变量未使用杰克逊进行序列化

时间:2018-11-29 05:06:06

标签: java hibernate jpa jackson transient

我忽略了通过@Transient注释在实体类中保存变量。此后我面临的问题是无法使用JACKSON将其序列化为JSON。

@Data
@Entity (name = "Pick")
@Table (name = "pick")
public class Pick {
    @Id
    @Column (name = "id")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;

    @Column (name = "vID")
    private Integer vD;

    @Column (name = "sID")
    private Integer sID;

    @Column (name = "rID")
    private Integer rID;

    @Column (name = "status")
    private String status;

    @Column (name = "category")
    private String category;

    @OneToMany
    @JoinColumn (name = "PickID")
    @Transient
    private List<Page> Pages;

}

0 个答案:

没有答案