package com.ifish.entity;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.ifish.serializer.CustomDateSerializer;

/** 
 * @ClassName: tbl_live_message 
 * @date 2015年7月2日 下午16:40:00 
 *  
 */
@Entity
@Table(name="tbl_live_message")
public class LiveMessage implements Serializable{

	private static final long serialVersionUID = -1369523508980093389L;
	/**
	 * ID
	 */
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(name="message_id")
	private Integer messageId;
	/**
	 * 直播间ID
	 */
	@Column(name="room_id",nullable=true)
	private Integer roomId;
	/**
	 * 用户ID
	 */
	@Column(name="user_id",nullable=true)
	private Integer userId;
	/**
	 * @用户ID
	 */
	@Column(name="as_user_id")
	private Integer asUserId;
	/**
	 * @用户名称
	 */
	@Transient
	private String asUserName;
	/**
	 * 头像
	 */
	@Transient
	private String userImg;
	/**
	 * 用户
	 */
	@Transient
	private String userName;
	/**
	 * 内容
	 */
	@Column(name="message_content",nullable=true,length=200)
	private String messageContent;
	/**
	 * 创建时间
	 */
	@JsonSerialize(using = CustomDateSerializer.class)
	@Column(name="create_time",columnDefinition="timestamp",updatable=false,length=1)
	private Date createTime;
	
	public Integer getMessageId() {
		return messageId;
	}
	public void setMessageId(Integer messageId) {
		this.messageId = messageId;
	}
	public Integer getRoomId() {
		return roomId;
	}
	public void setRoomId(Integer roomId) {
		this.roomId = roomId;
	}
	public Integer getUserId() {
		return userId;
	}
	public void setUserId(Integer userId) {
		this.userId = userId;
	}
	public String getMessageContent() {
		return messageContent;
	}
	public void setMessageContent(String messageContent) {
		this.messageContent = messageContent;
	}
	public Date getCreateTime() {
		return createTime;
	}
	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}
	public Integer getAsUserId() {
		return asUserId;
	}
	public void setAsUserId(Integer asUserId) {
		this.asUserId = asUserId;
	}
	public String getAsUserName() {
		return asUserName;
	}
	public void setAsUserName(String asUserName) {
		this.asUserName = asUserName;
	}
	public String getUserImg() {
		return userImg;
	}
	public void setUserImg(String userImg) {
		this.userImg = userImg;
	}
	public String getUserName() {
		return userName;
	}
	public void setUserName(String userName) {
		this.userName = userName;
	}
	
}
