orderItem (vo,item)
来源:互联网 发布:普通网络作家基本收入 编辑:程序博客网 时间:2024/06/14 07:51
import cn.itcast.shop.product.vo.Product;
public class OrderItem {
/*CREATE TABLE `orderitem` (
`itemid` int(11) NOT NULL AUTO_INCREMENT,
`count` int(11) DEFAULT NULL,
`subtotal` double DEFAULT NULL,
`pid` int(11) DEFAULT NULL,
`oid` int(11) DEFAULT NULL,
PRIMARY KEY (`itemid`),
KEY `FKE8B2AB6166C01961` (`oid`),
KEY `FKE8B2AB6171DB7AE4` (`pid`),
CONSTRAINT `FKE8B2AB6166C01961` FOREIGN KEY (`oid`) REFERENCES `orders` (`oid`),
CONSTRAINT `FKE8B2AB6171DB7AE4` FOREIGN KEY (`pid`) REFERENCES `product` (`pid`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
*/
private Integer itemid;
private Integer count;
private Double subtotal;
// 商品外键:对象
private Product product;
//订单的外键
private Order order;
public Integer getItemid() {
return itemid;
}
public void setItemid(Integer itemid) {
this.itemid = itemid;
}
public Integer getCount() {
return count;
}
public void setCount(Integer count) {
this.count = count;
}
public Double getSubtotal() {
return subtotal;
}
public void setSubtotal(Double subtotal) {
this.subtotal = subtotal;
}
public Product getProduct() {
return product;
}
public void setProduct(Product product) {
this.product = product;
}
public Order getOrder() {
return order;
}
public void setOrder(Order order) {
this.order = order;
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="cn.itcast.shop.order.vo.OrderItem" table="orderitem">
<id name="itemid">
<generator class="native"></generator>
</id>
<property name="count"></property>
<property name="subtotal"></property>
<!-- private Product product;
private Order order; -->
<many-to-one name="product" class="cn.itcast.shop.product.vo.Product" column="pid"></many-to-one>
<many-to-one name="order" class="cn.itcast.shop.order.vo.Order" column="oid"></many-to-one>
</class>
</hibernate-mapping>
- orderItem (vo,item)
- vo
- vo
- ITEM
- item
- item
- item
- item
- item
- VO , PO
- SSH错误:An association from the table orderitem refers to an unmapped class
- ADF: 区分VO定义和VO实例
- java vo转换成flex vo
- vo查询,vo更新等规范
- PO VO 之争
- About VO,PO,BO
- po->vo的转化
- VO&TO&BO
- SSH面试题整理
- 用Cookie来存储对象
- Learn file path relative and absolutly
- Apache服务器中设置虚拟主机
- Java数据结构和算法——栈
- orderItem (vo,item)
- iOS-获取webview的 url 和 title 和 html
- Akka并发编程——第八节:Actor模型(七)
- Homebrew简介及安装
- 非负权值有向图上的单源最短路径算法之Dijkstra算法
- Unity3d OnApplicationPause与OnApplicationFocus 在安卓平台的应用
- listener监听器_思维导图总结2
- Win10 IoT C#开发 2 - GPIO Pin 控制发光二极管
- (OK) cannot locate symbol "__sF" referenced by