package tutorial.core.models.entities;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Temporal;

/**
 * 
 * @author Xavier
 */
@Entity
public class Message implements Serializable{

    @Id
    @GeneratedValue
    @Column(name="message_id" )
    private Long message_id;
    @Temporal(javax.persistence.TemporalType.DATE)
    @Column( name="created" )
    private Date created;
    @Column( name="messageText", length = 10000 )
    private String messageText;
    @ManyToOne
    @JoinColumn(name = "account_id")
    private Account owner;

    public Long getMessage_id() {
        return message_id;
    }

    public void setMessage_id(Long message_id) {
        this.message_id = message_id;
    }

    public Date getCreated() {
        return created;
    }

    public void setCreated(Date created) {
        this.created = created;
    }

    public String getMessageText() {
        return messageText;
    }

    public void setMessageText(String messageText) {
        this.messageText = messageText;
    }

    public Account getOwner() {
        return owner;
    }

    public void setOwner(Account owner) {
        this.owner = owner;
    }
}
