/** perform this use case*/
public void apply()
{
// this will be our new object
Product newProduct = new Product();
// thma: attention, no sequence numbers yet for ojb/prevalyer
newProduct.setId((int)System.currentTimeMillis());
// now read in all relevant information and fill the new object:
System.out.println("please enter a new product");
String in = readLineWithMessage("enter name:");
newProduct.setName(in);
in = readLineWithMessage("enter price:");
newProduct.setPrice(Double.parseDouble(in));
in = readLineWithMessage("enter available stock:");
newProduct.setStock(Integer.parseInt(in));
// now perform persistence operations
try
{
// 1. open transaction