/**
* Author: Bob Chen
* Kylin Soong
*/
package com.jcommerce.core.model;
import java.sql.Timestamp;
import javax.persistence.Basic;
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.ManyToOne;
import javax.persistence.Table;
@Entity
@Table(name = "collect_goods")
public class CollectGoods extends ModelObject {
private Long id;
@Id
@GeneratedValue
@Basic(optional = false)
@Column(name = "id", nullable = false)
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
private static final long serialVersionUID = -4952659348730240009L;
private Goods goods;
private User user;
private Timestamp addTime;
private boolean attention;
@ManyToOne( cascade = { CascadeType.PERSIST, CascadeType.MERGE }, fetch = FetchType.LAZY )
@org.hibernate.annotations.Cascade({org.hibernate.annotations.CascadeType.SAVE_UPDATE})
@Basic( optional = true )
@JoinColumn(name = "goods_id", nullable = true )
public Goods getGoods() {
return goods;
}
public void setGoods(Goods goods) {
this.goods = goods;
}
@ManyToOne( cascade = { CascadeType.PERSIST, CascadeType.MERGE }, fetch = FetchType.LAZY )
@org.hibernate.annotations.Cascade({org.hibernate.annotations.CascadeType.SAVE_UPDATE})
@Basic( optional = true )
@JoinColumn(name = "user_id", nullable = true )
public User getUser() {
return user;
}
public void setUser(User user) {
this.user = user;
}
@Basic( optional = true )
@Column( name = "add_time" )
public Timestamp getAddTime() {
return addTime;
}
public void setAddTime(Timestamp addTime) {
this.addTime = addTime;
}
@Basic( optional = true )
@Column( name = "is_attention" )
public boolean isAttention() {
return attention;
}
public void setAttention(boolean attention) {
this.attention = attention;
}
}