博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
hibernate json数据死循环
阅读量:7119 次
发布时间:2019-06-28

本文共 5632 字,大约阅读时间需要 18 分钟。

package com.temp.entity;import java.util.Date;import java.util.HashSet;import java.util.Set;import javax.persistence.CascadeType;import javax.persistence.Column;import javax.persistence.Entity;import javax.persistence.FetchType;import javax.persistence.GeneratedValue;import static javax.persistence.GenerationType.IDENTITY;import javax.persistence.Id;import javax.persistence.OneToMany;import javax.persistence.Table;import org.hibernate.annotations.Cascade;import com.fasterxml.jackson.annotation.JsonIgnore;/** * TUser entity. @author MyEclipse Persistence Tools */@Entity@Table(name = "t_user", catalog = "temp")public class User implements IEntity {    // Fields    private Integer id;    private String tel;    private String userName;    private String password;    private String image;    private String name;    private String email;    private Date birthDate;    private Date lastDate;    private String loginIp;    private Date loginDate;    private Integer state;    private Date createDate;    private Date modifyDate;    private String tokenKey;    private String nickName;    private String sex;    private Integer age;    private Double height;    private Integer tempState;    private Double warnTemp;    private Set
TChilds = new HashSet
(0); @Id @GeneratedValue(strategy = IDENTITY) @Column(name = "id", unique = true, nullable = false) public Integer getId() { return this.id; } public void setId(Integer id) { this.id = id; } @Column(name = "tel", length = 20) public String getTel() { return this.tel; } public void setTel(String tel) { this.tel = tel; } @Column(name = "user_name", length = 20) public String getUserName() { return this.userName; } public void setUserName(String userName) { this.userName = userName; } @Column(name = "password", nullable = false, length = 32) public String getPassword() { return this.password; } public void setPassword(String password) { this.password = password; } @Column(name = "image", length = 200) public String getImage() { return this.image; } public void setImage(String image) { this.image = image; } @Column(name = "name", length = 10) public String getName() { return this.name; } public void setName(String name) { this.name = name; } @Column(name = "email", length = 100) public String getEmail() { return this.email; } public void setEmail(String email) { this.email = email; } @Column(name = "birth_date", length = 19) public Date getBirthDate() { return this.birthDate; } public void setBirthDate(Date birthDate) { this.birthDate = birthDate; } @Column(name = "last_date", length = 19) public Date getLastDate() { return this.lastDate; } public void setLastDate(Date lastDate) { this.lastDate = lastDate; } @Column(name = "login_ip", length = 50) public String getLoginIp() { return this.loginIp; } public void setLoginIp(String loginIp) { this.loginIp = loginIp; } @Column(name = "login_date", length = 19) public Date getLoginDate() { return this.loginDate; } public void setLoginDate(Date loginDate) { this.loginDate = loginDate; } @Column(name = "state", nullable = false) public Integer getState() { return this.state; } public void setState(Integer state) { this.state = state; } @Column(name = "create_date", nullable = false, length = 19) public Date getCreateDate() { return this.createDate; } public void setCreateDate(Date createDate) { this.createDate = createDate; } @Column(name = "modify_date", nullable = false, length = 19) public Date getModifyDate() { return this.modifyDate; } public void setModifyDate(Date modifyDate) { this.modifyDate = modifyDate; } @Column(name = "token_key", length = 200) public String getTokenKey() { return this.tokenKey; } public void setTokenKey(String tokenKey) { this.tokenKey = tokenKey; } @Column(name = "nick_name", length = 20) public String getNickName() { return this.nickName; } public void setNickName(String nickName) { this.nickName = nickName; } @Column(name = "sex", length = 5) public String getSex() { return this.sex; } public void setSex(String sex) { this.sex = sex; } @Column(name = "age") public Integer getAge() { return this.age; } public void setAge(Integer age) { this.age = age; } @Column(name = "height") public Double getHeight() { return this.height; } public void setHeight(Double height) { this.height = height; } @Column(name = "temp_state") public Integer getTempState() { return this.tempState; } public void setTempState(Integer tempState) { this.tempState = tempState; } @Column(name = "warn_temp", precision = 4) public Double getWarnTemp() { return this.warnTemp; } public void setWarnTemp(Double warnTemp) { this.warnTemp = warnTemp; } @OneToMany( fetch = FetchType.EAGER, mappedBy = "user") @Cascade(value=org.hibernate.annotations.CascadeType.SAVE_UPDATE) @JsonIgnore public Set
getTChilds() { return this.TChilds; } public void setTChilds(Set
TChilds) { this.TChilds = TChilds; }}

 

转载于:https://www.cnblogs.com/jinjixia/p/4845768.html

你可能感兴趣的文章
Configure swagger with spring boot
查看>>
nginx重定向规则入门
查看>>
初始化参数之memory_target
查看>>
趣题一则:寻找那扇门
查看>>
Oracle AWR报告提取方法
查看>>
好奇:WayOs破解、OEM、修复、打包等工具大全,满足大家的好奇心发下截图
查看>>
How to use kingshard building a MySQL cluster
查看>>
HibernateAnnotation入门实例
查看>>
iOS 基础介绍 1
查看>>
Qt 快捷键
查看>>
SAP HANA创建类型(SAP HANA CREATE TYPE):
查看>>
深入浅出CChart 每日一课——第十六课 实习之旅,百年老店之新锐WTL
查看>>
Signal Handling--ref
查看>>
SkinSharp用法
查看>>
大抚州泡粉
查看>>
【RMQ问题】求数组区间最大值,NYOJ-1185-最大最小值
查看>>
简易实现 TextView单行文本水平触摸滑动效果
查看>>
android调用系统相机拍照并保存在本地
查看>>
Node.js链式回调
查看>>
IOS中延时执行的几种方式的比较
查看>>