- - - Duplicate submit of the same transaction not allowed! - -
-- Sell a new item -
-diff --git a/spring-webflow-samples/sellitem/src/main/java/org/springframework/webflow/samples/sellitem/InMemoryDatabaseCreator.java b/spring-webflow-samples/sellitem/src/main/java/org/springframework/webflow/samples/sellitem/InMemoryDatabaseCreator.java
index 84f0937a..a0365260 100644
--- a/spring-webflow-samples/sellitem/src/main/java/org/springframework/webflow/samples/sellitem/InMemoryDatabaseCreator.java
+++ b/spring-webflow-samples/sellitem/src/main/java/org/springframework/webflow/samples/sellitem/InMemoryDatabaseCreator.java
@@ -21,8 +21,10 @@ public class InMemoryDatabaseCreator extends JdbcDaoSupport {
@Override
protected void initDao() throws Exception {
- String createSales = "create table T_SALES (ID int not null identity primary key, ITEM_COUNT int not null, PRICE double NOT NULL, category VARCHAR(1) NOT NULL, SHIPPING_TYPE varchar(1))";
- getJdbcTemplate().execute(createSales);
+ String createSalesSql =
+ "create table T_SALES (ID int not null identity primary key, ITEM_COUNT int not null, " +
+ "PRICE double NOT NULL, category VARCHAR(1) NOT NULL, SHIPPING_TYPE varchar(1))";
+ getJdbcTemplate().execute(createSalesSql);
}
}
diff --git a/spring-webflow-samples/sellitem/src/main/java/org/springframework/webflow/samples/sellitem/JdbcSaleProcessor.java b/spring-webflow-samples/sellitem/src/main/java/org/springframework/webflow/samples/sellitem/JdbcSaleProcessor.java
index a55674a1..3e2a8bff 100644
--- a/spring-webflow-samples/sellitem/src/main/java/org/springframework/webflow/samples/sellitem/JdbcSaleProcessor.java
+++ b/spring-webflow-samples/sellitem/src/main/java/org/springframework/webflow/samples/sellitem/JdbcSaleProcessor.java
@@ -18,6 +18,7 @@ package org.springframework.webflow.samples.sellitem;
import org.springframework.jdbc.core.support.JdbcDaoSupport;
public class JdbcSaleProcessor extends JdbcDaoSupport implements SaleProcessor {
+
public void process(Sale sale) {
getJdbcTemplate().update("insert into T_SALES values (?, ?, ?, ?, ?)",
new Object[] { null, sale.getPrice(), sale.getItemCount(), sale.getCategory(), sale.getShippingType() });
diff --git a/spring-webflow-samples/sellitem/src/main/java/org/springframework/webflow/samples/sellitem/SellItemFlowExecutionListener.java b/spring-webflow-samples/sellitem/src/main/java/org/springframework/webflow/samples/sellitem/SellItemFlowExecutionListener.java
index 6219975c..1b757892 100644
--- a/spring-webflow-samples/sellitem/src/main/java/org/springframework/webflow/samples/sellitem/SellItemFlowExecutionListener.java
+++ b/spring-webflow-samples/sellitem/src/main/java/org/springframework/webflow/samples/sellitem/SellItemFlowExecutionListener.java
@@ -24,6 +24,10 @@ import org.springframework.webflow.execution.EnterStateVetoException;
import org.springframework.webflow.execution.FlowExecutionListenerAdapter;
import org.springframework.webflow.execution.RequestContext;
+/**
+ * Flow execution listener that makes sure a user has the required role
+ * to enter a state.
+ */
public class SellItemFlowExecutionListener extends FlowExecutionListenerAdapter {
public void stateEntering(RequestContext context, StateDefinition nextState) throws EnterStateVetoException {
diff --git a/spring-webflow-samples/sellitem/src/main/java/org/springframework/webflow/samples/sellitem/services-config.xml b/spring-webflow-samples/sellitem/src/main/java/org/springframework/webflow/samples/sellitem/services-config.xml
index a01dab44..5042cb30 100644
--- a/spring-webflow-samples/sellitem/src/main/java/org/springframework/webflow/samples/sellitem/services-config.xml
+++ b/spring-webflow-samples/sellitem/src/main/java/org/springframework/webflow/samples/sellitem/services-config.xml
@@ -23,6 +23,7 @@