fastjson解析jpa,怎么返回了状态?
new: false ?????
我没有这个字段,这个是jpa的创建状态吧,false不是新建对象
怎么删掉?
@Entity
@Table(name = "tb_user")
@DynamicUpdate
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@Access(AccessType.FIELD) //强制hibernate全部访问字段注解
@Accessors(chain = true)
public class User extends BaseUUIDEntity implements Serializable {
private static final long serialVersionUID = 1L;
public enum Sex {
@MetaData("男")
MAN, //男
@MetaData("女")
WOMAN //女
}
@Column(name = "user_name", length = 20, nullable = false)
@MetaData("用户名")
private String userName;
@Column(name = "pass_word", length = 32)
@MetaData("密码")
private String passWord;
@Column(length = 12)
@MetaData("手机号")
private String phone;
@Column(name = "head_photo")
@MetaData("头像")
private String headPhoto;
@Enumerated(EnumType.STRING)
@Column(length = 5, columnDefinition = "varchar(5) default 'MAN'")
@MetaData("性别")
private Sex sex;
@Temporal(TemporalType.DATE)
@MetaData("生日")
private Date birthday;
@JSONField(serialize = false)
@ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.MERGE)
@JoinColumn(name = "merchant_id")
private Merchant merchant;
}
@ResponseBody
return ResponseEntity.ok(new Msg(HttpStatus.OK.value(), Constant.MESSAGE_SUCCESS, user.setPassWord("you don't want to know")));
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论