package org.catframework.agileworking.domain;

import java.io.Serializable;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToMany;

@Entity
public class User implements Serializable {

	private static final long serialVersionUID = -726326819568372268L;

	@Id
	@GeneratedValue
	private Long id;

	@Column(nullable = false, length = 200)
	private String name;

	@Column(nullable = false)
	private String mobileNo;

	@Column(nullable = false, unique = true)
	private String openId;

	@Column(nullable = false)
	private String nickName;

	@Column(nullable = false)
	private String avatarUrl;

	@ManyToMany(mappedBy="users")
	private List<Team> teams;
	
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getMobileNo() {
		return mobileNo;
	}

	public void setMobileNo(String mobileNo) {
		this.mobileNo = mobileNo;
	}

	public String getOpenId() {
		return openId;
	}

	public void setOpenId(String openId) {
		this.openId = openId;
	}

	public String getNickName() {
		return nickName;
	}

	public void setNickName(String nickName) {
		this.nickName = nickName;
	}

	public String getAvatarUrl() {
		return avatarUrl;
	}

	public void setAvatarUrl(String avatarUrl) {
		this.avatarUrl = avatarUrl;
	}

	public List<Team> getTeams() {
		return teams;
	}

	public void setTeams(List<Team> teams) {
		this.teams = teams;
	}
	
	
}

@@ -267,16 +267,69 @@
 oMany;%0A%0A
+import com.fasterxml.jackson.annotation.JsonIgnore;%0A%0A
 @Entity%0A
@@ -808,16 +808,29 @@
 users%22)%0A
+%09@JsonIgnore%0A
 %09private

修复了 User 和 Team 循环引用 OOM 的问题