日期:2014-05-18 浏览次数:21011 次
@JsonIgnoreProperties(ignoreUnknown = true)
public class FundDetail {
private static final long serialVersionUID = -2698868530610612322L;
private User user;
private Project project;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "user_id", nullable = false)
@JsonIgnoreProperties(value = { "hibernateLazyInitializer", "handler" })
public User getUser() {
return this.user;
}
public void setUser(User user) {
this.user = user;
}
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "project_id")
@JsonIgnoreProperties(value = { "hibernateLazyInitializer", "handler" })
public Project getProject() {
return this.project;
}
public void setProject(Project project) {
this.project = project;
}
@Transient
public String getUserName() {
return user.getName();
}
@JsonIgnore
@Transient
public String getProjectName() {
return project.getName();
}