Added Spring Java Conventions to all of the spring sub-projects and formatted them to meet the guidelines.
This commit is contained in:
@@ -21,9 +21,8 @@ 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))";
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,8 @@ public class JdbcSaleProcessor extends JdbcDaoSupport implements SaleProcessor {
|
||||
|
||||
public void process(Sale sale) {
|
||||
getJdbcTemplate()
|
||||
.update("insert into T_SALES values (?, ?, ?, ?, ?)",
|
||||
.update(
|
||||
"insert into T_SALES values (?, ?, ?, ?, ?)",
|
||||
new Object[] { null, sale.getItemCount(), sale.getPrice(), sale.getCategory(),
|
||||
sale.getShippingType() });
|
||||
}
|
||||
|
||||
@@ -89,8 +89,7 @@ public class Sale implements Serializable {
|
||||
if (itemCount >= 100) {
|
||||
discount = 0.1;
|
||||
}
|
||||
}
|
||||
else if ("B".equals(category)) {
|
||||
} else if ("B".equals(category)) {
|
||||
if (itemCount >= 200) {
|
||||
discount = 0.2;
|
||||
}
|
||||
@@ -112,8 +111,7 @@ public class Sale implements Serializable {
|
||||
double delCost = 0.0;
|
||||
if ("S".equals(shippingType)) {
|
||||
delCost = 10.0;
|
||||
}
|
||||
else if ("E".equals(shippingType)) {
|
||||
} else if ("E".equals(shippingType)) {
|
||||
delCost = 20.0;
|
||||
}
|
||||
return delCost;
|
||||
|
||||
@@ -25,7 +25,7 @@ public class SellItemAction extends AbstractAction {
|
||||
// an action is not needed for binding, you can still add in an action to do
|
||||
// something if you need to
|
||||
protected Event doExecute(RequestContext context) throws Exception {
|
||||
Sale sale = (Sale)context.getFlowScope().getRequired("sale", Sale.class);
|
||||
Sale sale = (Sale) context.getFlowScope().getRequired("sale", Sale.class);
|
||||
sale.getAmount();
|
||||
return success();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user