+ /**
+ * Adds product to database by given title, price and category id
+ * @param title Product title
+ * @param price Product price
+ * @param category Product category id
+ * @param available Availability of product (selectable by customer)
+ * @throws java.sql.SQLException If any SQL errors occur
+ */
+ @Override
+ public void addProduct (final String title, final Float price, final Long category, final Boolean available) throws SQLException, IOException {
+ // Trace message
+ this.getLogger().trace(MessageFormat.format("title={0},price={1},category={2} - CALLED!", title, price, category)); //NOI18N
+
+ // Title should not be null
+ if (title == null) {
+ // Abort here
+ throw new NullPointerException("title is null"); //NOI18N
+ } else if (price == null) {
+ // Abort here
+ throw new NullPointerException("price is null"); //NOI18N
+ } else if (category == null) {
+ // Abort here
+ throw new NullPointerException("category is null"); //NOI18N
+ } else if (available == null) {
+ // Abort here
+ throw new NullPointerException("available is null"); //NOI18N
+ }
+
+ // Clear dataset from previous usage
+ this.clearDataSet();
+
+ // Add title and parent
+ this.addToDataSet(PizzaProductDatabaseConstants.COLUMN_TITLE, title);
+ this.addToDataSet(PizzaProductDatabaseConstants.COLUMN_PRICE, price);
+ this.addToDataSet(PizzaProductDatabaseConstants.COLUMN_CATEGORY, category);
+ this.addToDataSet(PizzaProductDatabaseConstants.COLUMN_AVAILABLE, available);
+
+ // Handle this over to the backend
+ // @todo Nothing is done yet!
+ Result<? extends Storeable> result = this.doInsertDataSet();
+
+ // Debug message
+ this.getLogger().debug(MessageFormat.format("result={0}", result)); //NOI18N
+
+ // Trace message
+ this.getLogger().trace("EXIT!"); //NOI18N
+ }
+