package com.xmomen.module.wx.module.cart.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

import com.xmomen.framework.mybatis.model.BaseMybatisModel;

@Entity
@Table(name = "tb_shopping_cart")
public class TbCartItem extends BaseMybatisModel {

	// 购物车项ID
	private String id;
	
	// 用户Token
	private String userToken;
	
	// 商品ID
	private Integer itemId;
	
	// 商品数量
	private Integer itemNumber;
	
	// 获取购物车项ID
	@Column(name = "ID")
    @Id
    @GeneratedValue(generator = "UUIDGenerator")
    public String getId() {
        return id;
    }

    // 设置购物车项ID
    public void setId(String id) {
        this.id = id;
        if(id == null){
              removeValidField("id");
              return;
        }
        addValidField("id");
    }

    // 获取用户Token
    @Column(name = "USER_TOKEN")
    public String getUserToken() {
    	return userToken;
    }
    
    // 设置用户Token
    public void setUserToken(String userToken) {
    	this.userToken = userToken;
    	if(userToken == null) {
    		removeValidField("userToken");
    		return;
    	}
    	addValidField("userToken");
    }
    
    // 获取商品ID
    @Column(name = "ITEM_ID")
    public Integer getItemId() {
        return itemId;
    }

    // 设置商品ID
    public void setItemId(Integer itemId) {
        this.itemId = itemId;
        if(itemId == null){
              removeValidField("itemId");
              return;
        }
        addValidField("itemId");
    }

    // 获取商品数量
    @Column(name = "ITEM_NUMBER")
    public Integer getItemNumber() {
        return itemNumber;
    }

    // 设置商品数量
    public void setItemNumber(Integer itemNumber) {
        this.itemNumber = itemNumber;
        if(itemNumber == null){
              removeValidField("itemNumber");
              return;
        }
        addValidField("itemNumber");
    }

}
