orderitem.java
来自「该代码是Java数据库高级编程宝典中的重要的代码」· Java 代码 · 共 84 行
JAVA
84 行
package jdbcbook.shopping.form;
import org.apache.struts.action.ActionForm;
import java.math.BigDecimal;
import jdbcbook.shopping.database.OperateDB;
public class OrderItem extends ActionForm
{
// 主键
private int id;
public int getId( )
{
return this.id;
}
public void setId( int id )
{
this.id = id;
}
// 订单
private int ordersid;
public int getOrdersid( )
{
return this.ordersid;
}
public void setOrdersid( int ordersid )
{
this.ordersid = ordersid;
}
// 商品
private int productid;
public int getProductid( )
{
return this.productid;
}
public void setProductid( int productid )
{
this.productid = productid;
}
public Product getProduct()
{
return (Product)OperateDB.getObjectByID( Product.class, getProductid() );
}
// 数量
private int quantity;
public int getQuantity( )
{
return this.quantity;
}
public void setQuantity( int quantity )
{
this.quantity = quantity;
}
// 价格
private BigDecimal price;
public BigDecimal getPrice( )
{
return this.price;
}
public void setPrice( BigDecimal price )
{
this.price = price;
}
// 总费用
private BigDecimal totalfee;
public BigDecimal getTotalfee( )
{
return this.totalfee;
}
public void setTotalfee( BigDecimal totalfee )
{
this.totalfee = totalfee;
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?