日期:2014-05-19 浏览次数:20797 次
import static javax.persistence.GenerationType.IDENTITY;
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 javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import org.springframework.stereotype.Component;
@Component
@Entity
@Table(name = "aca_articlemode", catalog = "academic_administration")
public class ArticleMode implements java.io.Serializable {
private static final long serialVersionUID = 1L;
private Integer modeId;
private String modeName;
private String modeContent;
private Set<Article> articles = new HashSet<Article>(0);
public ArticleMode() {
}
public ArticleMode(Integer modeId, String modeName) {
this.modeId = modeId;
this.modeName = modeName;
}
public ArticleMode(Integer modeId, String modeName, String modeContent) {
this.modeId = modeId;
this.modeName = modeName;
this.modeContent = modeContent;
}
@Id
@GeneratedValue(strategy = IDENTITY)
@Column(name = "modeId", unique = true, nullable = false)
public Integer getModeId() {
return this.modeId;
}
public void setModeId(Integer modeId) {
this.modeId = modeId;
}
@Column(name = "modeName", nullable = false, length = 40)
public String getModeName() {
return this.modeName;
}
public void setModeName(String modeName) {
this.modeName = modeName;
}
@Column(name = "modeContent", length = 65535)
public String getModeContent() {
return this.modeContent;
}
public void setModeContent(String modeContent) {
this.modeContent = modeContent;
}
//@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "articlemode")
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "articlemode", targetEntity = Article.class)
@JoinColumn(name="articleId")
public Set<Article> getArticles() {
return articles;
}
public void setArticles(Set<Article> articles) {
this.articles = articles;
}
}
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinC