实体 map 属性

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

import javax.persistence.CollectionTable;
import javax.persistence.Column;
import javax.persistence.ElementCollection;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.MapKeyColumn;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;

import org.codehaus.jackson.annotate.JsonIgnoreProperties;
import org.springframework.web.multipart.MultipartFile;

/**
 * 实体类 用户需要输入的数据 file appname versionname versioncode updatecontent(option)
 * 
 * @author wyl
 */
@JsonIgnoreProperties(ignoreUnknown = true)
@Entity(name = "appInformation")
@Table(name = "app_information")
public class AppInformation implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Integer id;

	/*
	 * 应用程序名称,一个应用程序只有唯一的名称
	 */
	@Column(name = "appname", length = 100)
	private String appname;

	/*
	 * 版本名称 eg,测试版、稳定版
	 */
	@Column(name = "versionname", length = 100)
	private String versionname;

	/*
	 * details
	 */
	@Column(name = "versioncode")
	private int versioncode;

	/*
	 * 这个版本更新内容
	 */
	@Column(name = "updatecontent", length = 255)
	private String updatecontent;

	/**
	 * 上传的文件,不做持久化
	 */
	@Transient
	private MultipartFile file;
	/*
	 * 文件具体的名称
	 */
	@Column(name = "filename", length = 100)
	private String filename;

	/*
	 * 下载次数
	 */
	@Column(name = "downnum")
	private int downnum;

	/*
	 * 文件的路径
	 */
	@Column(name = "path", length = 255)
	private String path;

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "create_at", updatable = false)
	private Date createAt;
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "update_at")
	private Date updateAt;
	/**
	 * 创建人的id
	 */
	@Column(name = "create_by", length = 50, updatable = false)
	private String createBy;
	/**
	 * 创建人的id
	 */
	@Column(name = "update_by", length = 50)
	private String updateBy;

	/**
	 * 
	 * 可扩展的map
	 * 
	 */
	@ElementCollection
	@MapKeyColumn(name = "name")
	@Column(name = "value")
	@CollectionTable(name = "app_information_extra", joinColumns = @JoinColumn(name = "appId"))
	private Map<String, String> attributes;

	public String getAppname() {
		return appname;
	}

	public void setAppname(String appname) {
		this.appname = appname;
	}

	public String getVersionname() {
		return versionname;
	}

	public void setVersionname(String versionname) {
		this.versionname = versionname;
	}

	public int getVersioncode() {
		return versioncode;
	}

	public void setVersioncode(int versioncode) {
		this.versioncode = versioncode;
	}

	public String getUpdatecontent() {
		return updatecontent;
	}

	public void setUpdatecontent(String updatecontent) {
		this.updatecontent = updatecontent;
	}

	public MultipartFile getFile() {
		return file;
	}

	public void setFile(MultipartFile file) {
		this.file = file;
	}

	public String getFilename() {
		return filename;
	}

	public void setFilename(String filename) {
		this.filename = filename;
	}

	public int getDownnum() {
		return downnum;
	}

	public void setDownnum(int downnum) {
		this.downnum = downnum;
	}

	public String getPath() {
		return path;
	}

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

	public Date getCreateAt() {
		return createAt;
	}

	public void setCreateAt(Date createAt) {
		this.createAt = createAt;
	}

	public String getCreateBy() {
		return createBy;
	}

	public void setCreateBy(String createBy) {
		this.createBy = createBy;
	}

	public Map<String, String> getAttributes() {
		return attributes;
	}

	public void setAttributes(Map<String, String> attributes) {
		this.attributes = attributes;
	}

	public Date getUpdateAt() {
		return updateAt;
	}

	public void setUpdateAt(Date updateAt) {
		this.updateAt = updateAt;
	}

	public String getUpdateBy() {
		return updateBy;
	}

	public void setUpdateBy(String updateBy) {
		this.updateBy = updateBy;
	}

}



转载于:https://my.oschina.net/liyonglee/blog/358204

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值