Hibernate JPA中@Transient、@JsonIgnoreProperties、@JsonIgnore、@JsonFormat、@JsonSerialize等注解解释
1、@JsonIgnoreProperties
此注解是类注解,作用是json序列化时将java bean中的一些属性忽略掉,序列化和反序列化都受影响。
写法将此标签加在model 类的类名上 ,可以多个属性也可以单个属性
//生成json时将name和age属性过滤
@JsonIgnoreProperties({ "name"},{ "age"})
public class user {
private String name;
还没有评论,来说两句吧...