From cdcbed9af813b2a02cdc01eefa24db8bec6b51a9 Mon Sep 17 00:00:00 2001 From: yujian <yujian> Date: 星期三, 27 三月 2019 12:17:33 +0800 Subject: [PATCH] 主分类 + 子分类 DAO改造 --- fanli/src/main/java/com/yeshi/fanli/entity/bus/clazz/GoodsSecondClass.java | 87 +++++++++++++++++++++---------------------- 1 files changed, 43 insertions(+), 44 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/entity/bus/clazz/GoodsSecondClass.java b/fanli/src/main/java/com/yeshi/fanli/entity/bus/clazz/GoodsSecondClass.java index 1c03c1a..bb81859 100644 --- a/fanli/src/main/java/com/yeshi/fanli/entity/bus/clazz/GoodsSecondClass.java +++ b/fanli/src/main/java/com/yeshi/fanli/entity/bus/clazz/GoodsSecondClass.java @@ -1,14 +1,7 @@ package com.yeshi.fanli.entity.bus.clazz; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.Table; +import org.yeshi.utils.mybatis.Column; +import org.yeshi.utils.mybatis.Table; import com.google.gson.annotations.Expose; @@ -18,27 +11,32 @@ * @author Administrator * */ -@Entity -@Table(name = "yeshi_ec_second_class") +@Table("yeshi_ec_second_class") public class GoodsSecondClass { - @Id - @GeneratedValue(strategy = GenerationType.AUTO) + + @Expose @Column(name = "id") + private Long id; + @Expose - private long id; - @Expose - @Column(name = "`name`", length = 50) + @Column(name = "name") private String name; + @Expose - @Column(name = "`picture`", length = 1024) + @Column(name = "picture") private String picture; - private int orderby; - private long createtime; - @ManyToOne(fetch = FetchType.EAGER) - @JoinColumn(name = "pid") + + @Column(name = "pid") private GoodsClass parent; - @Column(name = "`key`", length = 10) + + @Column(name = "key") private String key; + + @Column(name = "orderby") + private Integer orderby; + + @Column(name = "createtime") + private Long createtime; public GoodsSecondClass() { } @@ -57,28 +55,12 @@ this.createtime = createtime; this.parent = parent; } - - public String getKey() { - return key; - } - public void setKey(String key) { - this.key = key; - } - - public GoodsClass getParent() { - return parent; - } - - public void setParent(GoodsClass parent) { - this.parent = parent; - } - - public long getId() { + public Long getId() { return id; } - public void setId(long id) { + public void setId(Long id) { this.id = id; } @@ -98,19 +80,36 @@ this.picture = picture; } - public int getOrderby() { + public GoodsClass getParent() { + return parent; + } + + public void setParent(GoodsClass parent) { + this.parent = parent; + } + + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public Integer getOrderby() { return orderby; } - public void setOrderby(int orderby) { + public void setOrderby(Integer orderby) { this.orderby = orderby; } - public long getCreatetime() { + public Long getCreatetime() { return createtime; } - public void setCreatetime(long createtime) { + public void setCreatetime(Long createtime) { this.createtime = createtime; } + } -- Gitblit v1.8.0