我有一个java类。这与许多其他java类有关。我想反序列化这个类。请帮我反序列化课程。我的课是这样的。。
@Entity @Table(name = "A", uniqueConstraints = @UniqueConstraint(columnNames = { "name" })) @JsonIdentityInfo(generator=ObjectIdGenerators.IntSequenceGenerator.class, property="@_refid") @JsonDeserialize(using=ADeSerializer.类)公共类A {
@Column(name = "name")
private String name;
@Column(name = "DESCRIPTION")
private String description;
//
@ManyToMany(cascade={CascadeType.REMOVE, CascadeType.MERGE},fetch=FetchType.EAGER)
@JoinTable(
name="B",
joinColumns={@JoinColumn(name="Aname")},
inverseJoinColumns={@JoinColumn(name="Bname", unique=true)}
)
@Fetch(FetchMode.SUBSELECT)
private Set<C> cs;
@ManyToMany(cascade={CascadeType.MERGE},fetch=FetchType.EAGER)
@JoinTable(
name="D",
joinColumns=@JoinColumn(name="Aname"),
inverseJoinColumns=@JoinColumn(name="Ename")
)
@Fetch(FetchMode.SUBSELECT)
private Set<E> Es;
@Cascade({org.hibernate.annotations.CascadeType.DELETE_ORPHAN})
@ManyToMany(cascade={CascadeType.ALL, CascadeType.MERGE},fetch=FetchType.EAGER)
@JoinTable(
name="F",
joinColumns=@JoinColumn(name="Aname"),
inverseJoinColumns=@JoinColumn(name="Fname")
)
@Fetch(FetchMode.SUBSELECT)
private Set<F> Fs;
// Getters and setters
}
说清楚...
Class A {
Object of Class B;
Object of Class C {
Set<ClassB> bs;
Objects of Class C;
Object of Class A
}
other local variables;
Objects of Class D{
set<ClassB> ds;
}
//getter 和 setter
}
我的休息服务是
@RequestMapping(value="/saveA", method=RequestMethod.POST) public @ResponseBody MIResponse saveA(@RequestBody A a) 抛出异常{
return null;
}