Time for action – creating a domain object
So far, in your webstore, you have showed only a welcome message. It is now time for you to show your first product on the web page. Do this by creating a domain object, as follows, to represent the product information:
Create a class called
Product
under thecom.packt.webstore.domain
package in the source foldersrc/main/java
. Now, add the following code into it:package com.packt.webstore.domain; import java.math.BigDecimal; public class Product { private String productId; private String name; private BigDecimal unitPrice; private String description; private String manufacturer; private String category; private long unitsInStock; private long unitsInOrder; private boolean discontinued; private String condition; public Product() { super(); } public Product(String productId, String name, BigDecimal unitPrice) { this.productId = productId; this.name = name; this.unitPrice = unitPrice; } // add setters...