NutzCN Logo
问答 nutz有生成guid的封装吗
发布于 3022天前 作者 Hamming 1794 次浏览 复制 上一个帖子 下一个帖子
标签:

nutz有生成guid的封装吗

10 回复

nutz 如何插入一条记录 记录ID 是 uiid呢

package nuoshang.bluejay.modules.models;
import org.nutz.dao.entity.annotation.*;

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

/**
 * 通过 DBCodeCreateTool 代码自动生成
 * @time 2016-08-24 15:02:08
 */
@Table("t_order")
public class Order implements Serializable{
    private static final long serialVersionUID = 1L;
    /********** attribute ***********/
    /**
     * 状态-删除
     */
    public static final String STATE_RM = "0";

    /**
     * 状态-待付款
     */
    public static final String STATE_OK = "1";

    /**
     * 状态-待发货
     */
    public static final String STATE_PAYMENT = "2";

    /**
     * 状态-待发货
     */
    public static final String STATE_RECEIPT = "3";

    /**
     * 状态-待评论
     */
    public static final String STATE_EVALUATE ="4";

    /**
     * 状态-退货
     */
    public static final String STATE_RETURN = "5";

    /**
     * 状态-关闭
     */
    public static final String STATE_CLOSE = "CLOSE";

    /****主订单编号 ****/
    @Id
    @Prev(els=@EL("uuid()"))
    @Column("order_id")
    private String order_id;
    /****用户编号 ****/
    @Column("ord_user_id")
    private int ord_user_id;
    /****物流信息 ****/
    @Column("ord_logi_id")
    private int ord_logi_id;
    /****支付方式 ****/
    @Column("pay_type")
    private String pay_type;
    /****订单状态 ****/
    @Column("order_statu")
    private String order_statu;
    /****结算金额 ****/
    @Column("settlement")
    private java.math.BigDecimal settlement;
    /****订单收货地址 ****/
    @Column("ord_add_id")
    private int ord_add_id;
    /****收货人 ****/
    @Column("consignee")
    private String consignee;
    /****电话 ****/
    @Column("phone")
    private String phone;

    @Column("address")
    private String address;
    /****邮编 ****/
    @Column("zip_code")
    private String zip_code;
    /****快递公司名称 ****/
    @Column("express")
    private String express;
    /****收货时间 ****/
    @Column("receiv_time")
    private Date receiv_time;
    /****下单时间 ****/
    @Column("create_time")
    private Date create_time;
    /****更新时间 ****/
    @Column("update_time")
    private Date update_time;

    @Many(target = Order_item.class, field = "oi_ord_id")
    private List<Order_item> items;
    
    public Order() {}
    public Order(String order_id, int ord_user_id, int ord_logi_id, String pay_type, String order_statu, java.math.BigDecimal settlement, int ord_add_id, String consignee, String phone, String address, String zip_code, String express, Date receiv_time, Date create_time, Date update_time) {
        this.order_id = order_id;
        this.ord_user_id = ord_user_id;
        this.ord_logi_id = ord_logi_id;
        this.pay_type = pay_type;
        this.order_statu = order_statu;
        this.settlement = settlement;
        this.ord_add_id = ord_add_id;
        this.consignee = consignee;
        this.phone = phone;
        this.address = address;
        this.zip_code = zip_code;
        this.express = express;
        this.receiv_time = receiv_time;
        this.create_time = create_time;
        this.update_time = update_time;
    }
    /********** get/set ***********/
    public String getOrder_id() {
        return order_id;
    }
    public void setOrder_id(String order_id) {
        this.order_id = order_id;
    }
    public int getOrd_user_id() {
        return ord_user_id;
    }
    public void setOrd_user_id(int ord_user_id) {
        this.ord_user_id = ord_user_id;
    }
    public int getOrd_logi_id() {
        return ord_logi_id;
    }
    public void setOrd_logi_id(int ord_logi_id) {
        this.ord_logi_id = ord_logi_id;
    }
    public String getPay_type() {
        return pay_type;
    }
    public void setPay_type(String pay_type) {
        this.pay_type = pay_type;
    }
    public String getOrder_statu() {
        return order_statu;
    }
    public void setOrder_statu(String order_statu) {
        this.order_statu = order_statu;
    }
    public java.math.BigDecimal getSettlement() {
        return settlement;
    }
    public void setSettlement(java.math.BigDecimal settlement) {
        this.settlement = settlement;
    }
    public int getOrd_add_id() {
        return ord_add_id;
    }
    public void setOrd_add_id(int ord_add_id) {
        this.ord_add_id = ord_add_id;
    }
    public String getConsignee() {
        return consignee;
    }
    public void setConsignee(String consignee) {
        this.consignee = consignee;
    }
    public String getPhone() {
        return phone;
    }
    public void setPhone(String phone) {
        this.phone = phone;
    }
    public String getAddress() {
        return address;
    }
    public void setAddress(String address) {
        this.address = address;
    }
    public String getZip_code() {
        return zip_code;
    }
    public void setZip_code(String zip_code) {
        this.zip_code = zip_code;
    }
    public String getExpress() {
        return express;
    }
    public void setExpress(String express) {
        this.express = express;
    }
    public Date getReceiv_time() {
        return receiv_time;
    }
    public void setReceiv_time(Date receiv_time) {
        this.receiv_time = receiv_time;
    }
    public Date getCreate_time() {
        return create_time;
    }
    public void setCreate_time(Date create_time) {
        this.create_time = create_time;
    }
    public Date getUpdate_time() {
        return update_time;
    }
    public void setUpdate_time(Date update_time) {
        this.update_time = update_time;
    }

    public List<Order_item> getItems() {
        return items;
    }

    public void setItems(List<Order_item> items) {
        this.items = items;
    }
}

实体类定义如下 插入报错如下

2016-09-13 14:15:39,640 [qtp1729863900-22] DEBUG org.nutz.mvc.impl.UrlMappingImpl - Found mapping for [POST] path=//order/add : OrderModule.Add(OrderModule.java:46)
2016-09-13 14:15:39,641 [qtp1729863900-22] DEBUG org.nutz.ioc.impl.NutIoc - Get 'orderModule'<class nuoshang.bluejay.modules.controllers.OrderModule>
2016-09-13 14:15:39,642 [qtp1729863900-22] DEBUG org.nutz.dao.impl.sql.run.NutDaoExecutor - SELECT * FROM t_address  WHERE user_address_id=?
    | 1 |
    |---|
    | 5 |
  For example:> "SELECT * FROM t_address  WHERE user_address_id=5"
2016-09-13 14:15:39,651 [qtp1729863900-22] DEBUG org.nutz.dao.impl.sql.run.NutDaoExecutor - SELECT * FROM t_sku  WHERE sku_id=?
    |  1 |
    |----|
    | 11 |
  For example:> "SELECT * FROM t_sku  WHERE sku_id=11"
2016-09-13 14:15:39,667 [qtp1729863900-22] DEBUG org.nutz.dao.impl.sql.run.NutDaoExecutor - UPDATE t_sku SET sku_goods_id=?,sku_inte_gid=?,remark=?,state=?,img=?,colour=?,size=?,count=?,ctime=?,utime=?  WHERE sku_id=?
    |  1 |    2 |    3 | 4 | 5 |   6 | 7 | 8 |                   9 |                  10 | 11 |
    |----|------|------|---|---|-----|---|---|---------------------|---------------------|----|
    | 11 | NULL | 女装上衣 | 1 | / |  黑色 | L | 5 | 2016-08-24 15:52:52 | 2016-09-13 14:15:39 | 11 |
  For example:> "UPDATE t_sku SET sku_goods_id=11,sku_inte_gid=NULL,remark='女装上衣',state='1',img='/',colour=' 黑色',size='L',count=5,ctime='2016-08-24 15:52:52',utime='2016-09-13 14:15:39'  WHERE sku_id=11"
2016-09-13 14:15:39,726 [qtp1729863900-22] DEBUG org.nutz.dao.impl.sql.run.NutDaoExecutor - SELECT * FROM t_sku  WHERE sku_id=?
    |  1 |
    |----|
    | 14 |
  For example:> "SELECT * FROM t_sku  WHERE sku_id=14"
nuoshang.bluejay.common.base.exception.IllegalParameterException: Illegal parameter was found during pre-check.

错误信息

org.nutz.dao.DaoException: Field(private java.lang.String nuoshang.bluejay.modules.models.Order.order_id) annotation @Id , but not Number type!!
@Table("t_article")
@Comment("文章")
public class Article extends Entity {

	@Name
	@Column("a_uid")
	@Comment("文章uuid")
	private String uid = R.UU16();

}

@Prev 注解

@Id是数值主键,@Name是文本主键

来自炫酷的 NutzCN

@wendal 如果设置成@name 就不能设置一对多关系了

怎么又扯上一对多了? 关联字段的类型要一样.

@wendal

2016-09-13 14:46:09,108 [qtp1930629187-21] DEBUG org.nutz.mvc.impl.UrlMappingImpl - Found mapping for [POST] path=//order/add : OrderModule.Add(OrderModule.java:46)
2016-09-13 14:46:09,109 [qtp1930629187-21] DEBUG org.nutz.ioc.impl.NutIoc - Get 'orderModule'<class nuoshang.bluejay.modules.controllers.OrderModule>
2016-09-13 14:46:09,116 [qtp1930629187-21] DEBUG org.nutz.dao.impl.sql.run.NutDaoExecutor - SELECT * FROM t_address  WHERE user_address_id=?
    | 1 |
    |---|
    | 5 |
  For example:> "SELECT * FROM t_address  WHERE user_address_id=5"
2016-09-13 14:46:09,125 [qtp1930629187-21] DEBUG org.nutz.dao.impl.sql.run.NutDaoExecutor - SELECT * FROM t_sku  WHERE sku_id=?
    |  1 |
    |----|
    | 11 |
  For example:> "SELECT * FROM t_sku  WHERE sku_id=11"
2016-09-13 14:46:09,135 [qtp1930629187-21] DEBUG org.nutz.dao.impl.sql.run.NutDaoExecutor - UPDATE t_sku SET sku_goods_id=?,sku_inte_gid=?,remark=?,state=?,img=?,colour=?,size=?,count=?,ctime=?,utime=?  WHERE sku_id=?
    |  1 |    2 |    3 | 4 | 5 |   6 | 7 |   8 |                   9 |                  10 | 11 |
    |----|------|------|---|---|-----|---|-----|---------------------|---------------------|----|
    | 11 | NULL | 商品11 | 1 | / |  黑色 | L | 489 | 2016-08-24 15:52:52 | 2016-09-13 14:46:09 | 11 |
  For example:> "UPDATE t_sku SET sku_goods_id=11,sku_inte_gid=NULL,remark='商品11',state='1',img='/',colour=' 黑色',size='L',count=489,ctime='2016-08-24 15:52:52',utime='2016-09-13 14:46:09'  WHERE sku_id=11"
2016-09-13 14:46:09,200 [qtp1930629187-21] DEBUG org.nutz.dao.impl.sql.run.NutDaoExecutor - SELECT * FROM t_sku  WHERE sku_id=?
    |  1 |
    |----|
    | 14 |
  For example:> "SELECT * FROM t_sku  WHERE sku_id=14"
2016-09-13 14:46:09,215 [qtp1930629187-21] DEBUG org.nutz.dao.impl.sql.run.NutDaoExecutor - UPDATE t_sku SET sku_goods_id=?,sku_inte_gid=?,remark=?,state=?,img=?,colour=?,size=?,count=?,ctime=?,utime=?  WHERE sku_id=?
    |  1 |    2 |    3 | 4 |    5 |  6 | 7 |   8 |    9 |                  10 | 11 |
    |----|------|------|---|------|----|---|-----|------|---------------------|----|
    | 12 | NULL | 商品12 | 1 | NULL | 白色 | L | 978 | NULL | 2016-09-13 14:46:09 | 14 |
  For example:> "UPDATE t_sku SET sku_goods_id=12,sku_inte_gid=NULL,remark='商品12',state='1',img=NULL,colour='白色',size='L',count=978,ctime=NULL,utime='2016-09-13 14:46:09'  WHERE sku_id=14"
2016-09-13 14:46:09,290 [qtp1930629187-21] DEBUG org.nutz.dao.impl.sql.run.NutDaoExecutor - INSERT INTO t_order(order_id,ord_user_id,ord_logi_id,pay_type,order_statu,settlement,ord_add_id,consignee,phone,address,zip_code,express,receiv_time,create_time,update_time) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) 
    |                                1 | 2 | 3 |    4 | 5 |   6 | 7 |   8 |       9 |   10 |     11 |   12 |   13 |                  14 |                  15 |
    |----------------------------------|---|---|------|---|-----|---|-----|---------|------|--------|------|------|---------------------|---------------------|
    | e8c381b7d7ae4eb2943ed3b31b755afe | 5 | 0 | NULL | 1 | 800 | 5 | 罗某某 | 8099999 | 同德广场 | 650102 | NULL | NULL | 2016-09-13 14:46:09 | 2016-09-13 14:46:09 |
  For example:> "INSERT INTO t_order(order_id,ord_user_id,ord_logi_id,pay_type,order_statu,settlement,ord_add_id,consignee,phone,address,zip_code,express,receiv_time,create_time,update_time) VALUES('e8c381b7d7ae4eb2943ed3b31b755afe',5,0,NULL,'1','800',5,'罗某某','8099999','同德广场','650102',NULL,NULL,'2016-09-13 14:46:09','2016-09-13 14:46:09') "
2016-09-13 14:46:09,327 [qtp1930629187-21] DEBUG org.nutz.dao.impl.sql.run.NutDaoExecutor - INSERT INTO t_order_item(oi_ord_id,item_state,ord_goods_id,oi_sku_id,good_amount,sprice_snapshot,settle_price,discount,total_price,create_time,update_time) VALUES(?,?,?,?,?,?,?,?,?,?,?) 
    |                                1 | 2 |  3 |  4 | 5 |   6 |  7 | 8 |    9 |                  10 |                  11 |
    |----------------------------------|---|----|----|---|-----|----|---|------|---------------------|---------------------|
    | e8c381b7d7ae4eb2943ed3b31b755afe | 1 | 11 | 11 | 1 | 150 | 99 | 0 | NULL | 2016-09-13 14:46:09 | 2016-09-13 14:46:09 |
  For example:> "INSERT INTO t_order_item(oi_ord_id,item_state,ord_goods_id,oi_sku_id,good_amount,sprice_snapshot,settle_price,discount,total_price,create_time,update_time) VALUES('e8c381b7d7ae4eb2943ed3b31b755afe','1',11,11,1,'150','99',0,NULL,'2016-09-13 14:46:09','2016-09-13 14:46:09') "
2016-09-13 14:46:09,336 [qtp1930629187-21] DEBUG org.nutz.dao.impl.sql.run.NutDaoExecutor - SQLException
java.sql.SQLException: Incorrect integer value: 'e8c381b7d7ae4eb2943ed3b31b755afe' for column 'oi_ord_id' at row 1
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:963)
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3966)
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3902)
	at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2526)
	at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2673)
	at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2549)
	at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1861)
	at com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:1192)
	at com.alibaba.druid.pool.DruidPooledPreparedStatement.execute(DruidPooledPreparedStatement.java:493)
	at org.nutz.dao.impl.sql.run.NutDaoExecutor._runPreparedStatement(NutDaoExecutor.java:268)
	at org.nutz.dao.impl.sql.run.NutDaoExecutor.exec(NutDaoExecutor.java:82)
	at org.nutz.dao.impl.DaoSupport$DaoExec.invoke(DaoSupport.java:334)
	at org.nutz.dao.impl.sql.run.NutDaoRunner.run(NutDaoRunner.java:38)
	at org.nutz.dao.impl.DaoSupport.run(DaoSupport.java:257)
	at org.nutz.dao.impl.DaoSupport$DaoExec.run(DaoSupport.java:324)
	at org.nutz.trans.Trans.exec(Trans.java:174)
	at org.nutz.dao.impl.DaoSupport._exec(DaoSupport.java:294)
	at org.nutz.dao.impl.EntityOperator.exec(EntityOperator.java:50)
	at org.nutz.dao.impl.NutDao.insertWith(NutDao.java:230)
	at nuoshang.bluejay.modules.dao.impl.OrderDaoImpl.insertWithItems(OrderDaoImpl.java:48)
	at nuoshang.bluejay.modules.services.OrderService.save(OrderService.java:35)
	at nuoshang.bluejay.modules.controllers.OrderModule.Add(OrderModule.java:52)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.nutz.mvc.impl.processor.MethodInvokeProcessor.process(MethodInvokeProcessor.java:25)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.AdaptorProcessor.process(AdaptorProcessor.java:33)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.ActionFiltersProcessor.process(ActionFiltersProcessor.java:58)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.ModuleProcessor.process(ModuleProcessor.java:123)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.EncodingProcessor.process(EncodingProcessor.java:27)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.UpdateRequestAttributesProcessor.process(UpdateRequestAttributesProcessor.java:15)
	at org.nutz.mvc.impl.NutActionChain.doChain(NutActionChain.java:44)
	at org.nutz.mvc.impl.ActionInvoker.invoke(ActionInvoker.java:67)
	at org.nutz.mvc.ActionHandler.handle(ActionHandler.java:31)
	at org.nutz.mvc.NutFilter.doFilter(NutFilter.java:198)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1288)
	at com.alibaba.druid.support.http.WebStatFilter.doFilter(WebStatFilter.java:123)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1288)
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:443)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:556)
	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:227)
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1044)
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:372)
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:189)
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:978)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
	at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:255)
	at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:154)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
	at org.eclipse.jetty.server.Server.handle(Server.java:369)
	at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:486)
	at org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:944)
	at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:1005)
	at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:865)
	at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:240)
	at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
	at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:667)
	at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
	at java.lang.Thread.run(Thread.java:745)
org.nutz.dao.DaoException: !Nutz SQL Error: 'INSERT INTO t_order_item(oi_ord_id,item_state,ord_goods_id,oi_sku_id,good_amount,sprice_snapshot,settle_price,discount,total_price,create_time,update_time) VALUES(?,?,?,?,?,?,?,?,?,?,?) 
    |                                1 | 2 |  3 |  4 | 5 |   6 |  7 | 8 |    9 |                  10 |                  11 |
    |----------------------------------|---|----|----|---|-----|----|---|------|---------------------|---------------------|
    | e8c381b7d7ae4eb2943ed3b31b755afe | 1 | 11 | 11 | 1 | 150 | 99 | 0 | NULL | 2016-09-13 14:46:09 | 2016-09-13 14:46:09 |
  For example:> "INSERT INTO t_order_item(oi_ord_id,item_state,ord_goods_id,oi_sku_id,good_amount,sprice_snapshot,settle_price,discount,total_price,create_time,update_time) VALUES('e8c381b7d7ae4eb2943ed3b31b755afe','1',11,11,1,'150','99',0,NULL,'2016-09-13 14:46:09','2016-09-13 14:46:09') "'
PreparedStatement: 
'INSERT INTO t_order_item(oi_ord_id,item_state,ord_goods_id,oi_sku_id,good_amount,sprice_snapshot,settle_price,discount,total_price,create_time,update_time) VALUES(?,?,?,?,?,?,?,?,?,?,?) '
CaseMessage=Incorrect integer value: 'e8c381b7d7ae4eb2943ed3b31b755afe' for column 'oi_ord_id' at row 1

一对多关系里面 报错了 类型都是string
订单的ID定义如下

    /****主订单编号 ****/
//    @Id
    @Name
    @ColDefine(type = ColType.VARCHAR, width = 32)
    @Prev(els=@EL("uuid()"))
    @Column("order_id")
    private String order_id;
package nuoshang.bluejay.modules.models;
import org.nutz.dao.entity.annotation.Column;
import org.nutz.dao.entity.annotation.Id;
import org.nutz.dao.entity.annotation.One;
import org.nutz.dao.entity.annotation.Table;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
 * 通过 DBCodeCreateTool 代码自动生成
 * @author
 * @time 2016-08-12 14:55:26
 */
@Table("t_order_item")
public class Order_item implements Serializable{
    private static final long serialVersionUID = 1L;
    /********** attribute ***********/
    /**
     * 状态-删除
     */
    public static final String STATE_RM = "0";

    /**
     * 状态-有效
     */
    public static final String STATE_OK = "1";

    /**
     * 状态-退货
     */
    public static final String STATE_RETURN = "2";

    /**
     * 退货原因-质量问题
     */
    public static final String RETURN_REASON_QUANLITY = "1";

    /**
     * 退货原因-尺码不合适
     */
    public static final String RETURN_REASON_SIZE = "2";

    /****副订单编号 ****/
    @Id
    @Column("ord_item_id")
    private int ord_item_id;

    /****主订单编号 ****/
    @Column("oi_ord_id")
    private String oi_ord_id;

    //订单详情状态
    @Column("item_state")
    private String item_state;

    /****商品编号 ****/
    @Column("ord_goods_id")
    private int ord_goods_id;

    //库存ID
    @Column("oi_sku_id")
    private int oi_sku_id;


    /****商品数量 ****/
    @Column("good_amount")
    private int good_amount;

    /****商品单价 ****/
    @Column("sprice_snapshot")
    private java.math.BigDecimal sprice_snapshot;

    /****结算价 ****/
    @Column("settle_price")
    private java.math.BigDecimal settle_price;

    /****商品折扣 ****/
    @Column("discount")
    private int discount;

    /****商品总价 ****/
    @Column("total_price")
    private java.math.BigDecimal total_price;

    @Column("create_time")
    private Date create_time;
    /****更新时间 ****/
    @Column("update_time")
    private Date update_time;

    @One(target = Order.class, field = "oi_ord_id")
    private Order order;

    public Order_item() {}
    public Order_item(int ord_item_id, String oi_ord_id, int ord_goods_id, int good_amount, java.math.BigDecimal good_price, java.math.BigDecimal prefer_price, int discount, java.math.BigDecimal total_price) {
        this.ord_item_id = ord_item_id;
        this.oi_ord_id = oi_ord_id;
        this.ord_goods_id = ord_goods_id;
        this.good_amount = good_amount;

        this.discount = discount;
        this.total_price = total_price;
    }
    /********** get/set ***********/
    public int getOrd_item_id() {
        return ord_item_id;
    }
    public void setOrd_item_id(int ord_item_id) {
        this.ord_item_id = ord_item_id;
    }
    public String getOi_ord_id() {
        return oi_ord_id;
    }
    public void setOi_ord_id(String oi_ord_id) {
        this.oi_ord_id = oi_ord_id;
    }
    public int getOrd_goods_id() {
        return ord_goods_id;
    }
    public void setOrd_goods_id(int ord_goods_id) {
        this.ord_goods_id = ord_goods_id;
    }
    public int getGood_amount() {
        return good_amount;
    }
    public void setGood_amount(int good_amount) {
        this.good_amount = good_amount;
    }

    public BigDecimal getSprice_snapshot() {
        return sprice_snapshot;
    }

    public void setSprice_snapshot(BigDecimal sprice_snapshot) {
        this.sprice_snapshot = sprice_snapshot;
    }

    public BigDecimal getSettle_price() {
        return settle_price;
    }

    public void setSettle_price(BigDecimal settle_price) {
        this.settle_price = settle_price;
    }

    public int getDiscount() {
        return discount;
    }
    public void setDiscount(int discount) {
        this.discount = discount;
    }
    public java.math.BigDecimal getTotal_price() {
        return total_price;
    }
    public void setTotal_price(java.math.BigDecimal total_price) {
        this.total_price = total_price;
    }

    public String getItem_state() {
        return item_state;
    }

    public void setItem_state(String item_state) {
        this.item_state = item_state;
    }

    public Order getOrder() {
        return order;
    }

    public void setOrder(Order order) {
        this.order = order;
    }

    public Date getCreate_time() {
        return create_time;
    }

    public void setCreate_time(Date create_time) {
        this.create_time = create_time;
    }

    public Date getUpdate_time() {
        return update_time;
    }

    public void setUpdate_time(Date update_time) {
        this.update_time = update_time;
    }

    public int getOi_sku_id() {
        return oi_sku_id;
    }

    public void setOi_sku_id(int oi_sku_id) {
        this.oi_sku_id = oi_sku_id;
    }
}


@wendal 找到错了 一对多的表 类型忘了改了

添加回复
请先登陆
回到顶部