package com.uas.platform.b2b.model;

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

@Entity
@Table(name = "attachs")
public class Attach {

	@Id
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "attachs_gen")
	@SequenceGenerator(name = "attachs_gen", sequenceName = "attachs_seq", allocationSize = 1)
	@Column(name = "at_id")
	private Long id;
	/**
	 * 路径
	 */
	@Column(name = "at_path")
	private String path;
	/**
	 * 描述语
	 */
	@Column(name = "at_description")
	private String description;
	/**
	 * 文件名称
	 */
	@Column(name = "at_name")
	private String name;

	/**
	 * 文件大小
	 */
	@Column(name = "at_size")
	private Long size;
	
	@Transient
	private Long sourceId;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getPath() {
		return path;
	}

	public void setPath(String path) {
		this.path = path;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Long getSize() {
		return size;
	}

	public void setSize(Long size) {
		this.size = size;
	}

	public Long getSourceId() {
		return sourceId;
	}

	public void setSourceId(Long sourceId) {
		this.sourceId = sourceId;
	}

	public Attach() {
	}

	/**
	 * @param fileName
	 *            文件名
	 * @param filePath
	 *            文件物理路径
	 * @param description
	 *            描述
	 * @param size
	 *            大小
	 */
	public Attach(String fileName, String filePath, String description, long size) {
		this.name = fileName;
		this.path = filePath;
		this.description = description;
		this.size = size;
	}

}
