- package com.imooc.dataobject;
- import lombok.Data;
- import org.hibernate.annotations.DynamicUpdate;
- import javax.persistence.Entity;
- import javax.persistence.GeneratedValue;
- import javax.persistence.Id;
- import java.util.Date;
- /**
- * 类目
- * Created by 廖师兄
- * 2017-05-07 14:30
- */
- @Entity // 映射数据库
- @DynamicUpdate // 时间自动更新
- @Data // 省略 set get , 需要下载 lombok 插件
- public class ProductCategory {
- /** 类目 id. */
- @Id
- @GeneratedValue
- private Integer categoryId;
- /** 类目名字. */
- private String categoryName;
- /** 类目编号. */
- private Integer categoryType;
- private Date createTime;
- private Date updateTime;
- public ProductCategory() {
- }
- public ProductCategory(String categoryName, Integer categoryType) {
- this.categoryName = categoryName;
- this.categoryType = categoryType;
- }
- }
来源: http://www.bubuko.com/infodetail-2970388.html