package com.lst.lc.entities;
// Generated 2015-7-18 14:55:52 by Hibernate Tools 4.3.1
import java.util.HashSet;
import java.util.Set;
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.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.Table;
/**
* BlogTag generated by hbm2java
*/
@Entity
@Table(name = "blogTag", catalog = "LearningCommunity")
public class BlogTag implements java.io.Serializable {
private Integer blogTagId;
private String tagName;
private int number;
private Set<Blog> blogs = new HashSet<Blog>(0);
public BlogTag() {
}
public BlogTag(String tagName, int number) {
this.tagName = tagName;
this.number = number;
}
public BlogTag(String tagName, int number, Set<Blog> blogs) {
this.tagName = tagName;
this.number = number;
this.blogs = blogs;
}
@Id
@GeneratedValue(strategy = IDENTITY)
@Column(name = "blogTagId", unique = true, nullable = false)
public Integer getBlogTagId() {
return this.blogTagId;
}
public void setBlogTagId(Integer blogTagId) {
this.blogTagId = blogTagId;
}
@Column(name = "tagName", nullable = false, length = 50)
public String getTagName() {
return this.tagName;
}
public void setTagName(String tagName) {
this.tagName = tagName;
}
@Column(name = "number", nullable = false)
public int getNumber() {
return this.number;
}
public void setNumber(int number) {
this.number = number;
}
@ManyToMany(fetch = FetchType.LAZY)
@JoinTable(name = "relBlogTag", catalog = "LearningCommunity", joinColumns = { @JoinColumn(name = "blogTagId", nullable = false, updatable = false) }, inverseJoinColumns = { @JoinColumn(name = "blogId", nullable = false, updatable = false) })
public Set<Blog> getBlogs() {
return this.blogs;
}
public void setBlogs(Set<Blog> blogs) {
this.blogs = blogs;
}
}