⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 salesorderlineitem.java

📁 Sample Hibernate Shopping Cart Application
💻 JAVA
字号:
package org.simplecart.contract.salesorder;

import org.simplecart.shopcart.catalog.ProductOption;
import org.simplecart.base.Persistent;
import org.simplecart.contract.LineItem;

/**
 * An Internet LineItem does not maintain a reference to the SalesOrder that
 * owns it. This is intented to increase performance for web-based uses.
 */
public class SalesOrderLineItem  implements LineItem, Persistent {
    
    private Long id;
    private float quantity;
    private float unitPrice;
    private ProductOption option;
    private String comment;
    
    /**
     * Default no args constructor
     */
    public SalesOrderLineItem() {
    }
    
    /**
     * Full constructor
     *
     * @param quantity
     * @param unitCost
     * @param option
     */
    public SalesOrderLineItem(
            float quantity,
            float unitPrice,
            String comment,
            ProductOption option) {
        this.quantity = quantity;
        this.unitPrice = unitPrice;
        this.setComment(comment);
        this.option = option;
    }
    
    public Long getId() {
        return id;
    }
    
    public float getQuantity() {
        return quantity;
    }
    
    public void setQuantity(float quantity) {
        this.quantity = quantity;
    }
    
    public float getUnitPrice() {
        return unitPrice;
    }
    
    public void setUnitPrice(float unitCost) {
        this.unitPrice = unitCost;
    }
    
    public ProductOption getOption() {
        return option;
    }
    
    public void setOption(ProductOption option) {
        this.option = option;
    }
    
    public float getLineItemTotalCost() {
        return (this.unitPrice*this.quantity);
    }

    public String getComment() {
        return comment;
    }

    public void setComment(String comment) {
        this.comment = comment;
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -