Commit 9f0df678 by tyfanchz

实体类修改

1 parent 7fa826dd
......@@ -11,7 +11,7 @@ CREATE TABLE `t_platform_customer`
`city` INT(11) DEFAULT NULL COMMENT '城市 sys_area的id',
`area` INT(11) DEFAULT NULL COMMENT '区 sys_area的id',
`address` VARCHAR(128) DEFAULT NULL COMMENT '详细地址',
`status` TINYINT(2) DEFAULT NULL COMMENT '账号状态 0 停用 1 正常 2 待审核 3 审核未通过',
`status` TINYINT(2) DEFAULT 2 COMMENT '账号状态 0 停用 1 正常 2 待审核 3 审核未通过',
`key_id` INT(11) DEFAULT NULL COMMENT '秘钥 t_platform_secretkey的id',
`channel_number` VARCHAR(32) DEFAULT NULL COMMENT '渠道号',
`create_time` DATETIME DEFAULT NULL COMMENT '创建d时间',
......
......@@ -5,6 +5,8 @@ import javax.persistence.ConstraintMode;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.ForeignKey;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Transient;
......@@ -21,23 +23,37 @@ import org.hibernate.annotations.Table;
@Table(appliesTo = "t_shop_cart", comment = "购物车")
@Entity(name = "t_shop_cart")
public class Cart extends ShopBaseEntity {
@Id
@GeneratedValue
private Long id;
@Column(name = "id_user", columnDefinition = "BIGINT COMMENT '用户id'")
private Long idUser;
@JoinColumn(name = "id_user", insertable = false, updatable = false, foreignKey = @ForeignKey(name = "none", value = ConstraintMode.NO_CONSTRAINT))
@JoinColumn(name = "id_user", insertable = false, updatable = false,
foreignKey = @ForeignKey(name = "none", value = ConstraintMode.NO_CONSTRAINT))
@ManyToOne(fetch = FetchType.LAZY)
private ShopUser user;
//private ShopUser user;
private PlatformUser user;
@Column(name = "id_goods", columnDefinition = "BIGINT COMMENT '商品id'")
private Long idGoods;
@JoinColumn(name = "id_goods", insertable = false, updatable = false, foreignKey = @ForeignKey(name = "none", value = ConstraintMode.NO_CONSTRAINT))
@JoinColumn(name = "id_goods", insertable = false, updatable = false,
foreignKey = @ForeignKey(name = "none", value = ConstraintMode.NO_CONSTRAINT))
@ManyToOne(fetch = FetchType.LAZY)
private Goods goods;
@Column(name = "id_sku", columnDefinition = "BIGINT COMMENT 'skuId'")
private Long idSku;
@JoinColumn(name = "id_sku", insertable = false, updatable = false, foreignKey = @ForeignKey(name = "none", value = ConstraintMode.NO_CONSTRAINT))
@ManyToOne(fetch = FetchType.LAZY)
private GoodsSku sku;
@Column(columnDefinition = "varchar(16) COMMENT '数量'")
private BigDecimal count;
@Transient
private BigDecimal price;
......@@ -49,6 +65,7 @@ public class Cart extends ShopBaseEntity {
}
public String getTitle() {
return idSku != null ? getGoods().getName() + " " + getSku().getCodeName() : getGoods().getName();
return idSku != null ? getGoods().getName() + " " + getSku().getCodeName() : getGoods()
.getName();
}
}
......@@ -23,7 +23,8 @@ public class Favorite extends ShopBaseEntity {
private Long idUser;
@JoinColumn(name = "id_user", insertable = false, updatable = false, foreignKey = @ForeignKey(name = "none", value = ConstraintMode.NO_CONSTRAINT))
@ManyToOne(fetch = FetchType.LAZY)
private ShopUser user;
//private ShopUser user;
private PlatformUser user;
@Column(name = "id_goods", columnDefinition = "BIGINT COMMENT '商品id'")
private Long idGoods;
@JoinColumn(name = "id_goods", insertable = false, updatable = false, foreignKey = @ForeignKey(name = "none", value = ConstraintMode.NO_CONSTRAINT))
......
......@@ -31,7 +31,8 @@ public class Order extends ShopBaseEntity {
private Long idUser;
@JoinColumn(name = "id_user", referencedColumnName = "id", insertable = false, updatable = false, foreignKey = @ForeignKey(name = "none", value = ConstraintMode.NO_CONSTRAINT))
@ManyToOne(fetch = FetchType.LAZY)
private ShopUser user;
//private ShopUser user;
private PlatformUser user;
@Column(columnDefinition = "VARCHAR(32) COMMENT '订单号'")
private String orderSn;
/**
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!