/** * Searches database to see if productId is in it. * * @param productId * @return product information if its found in database */ public Product searchForProductById(String productId) { CompanyDatabase cdb = new CompanyDatabase(); return cdb.searchForProductById(productId); }
/** * @param productId * @param qty Line item constructor that has productId, qty. */ public LineItem(String productId, int qty) { CompanyDatabase cdb = new CompanyDatabase(); product = cdb.searchForProductById(productId); this.qty = qty; }