Java Reference
In-Depth Information
+ account.getTransactions().size() + " transactions.";
}
return output;
}
package com.apress.springbatch.statement.domain;
import java.math.BigDecimal;
import java.util.Date;
public class Transaction {
private long id;
private long accountId;
private String accountNumber;
private String ticker;
private long tickerId;
private long quantity;
private Date tradeTimestamp;
private BigDecimal dollarAmount;
private TransactionType type;
// Accessors removed
...
@Override
public String toString() {
return "Sold " + quantity + " of " + ticker;
}
}
You should immediately notice in the Customer and Transaction classes that they both contain a
variety of data types including an Address object and an Account object for the Customer object. Listing
10-8 shows the code for those additional domain objects.
Listing 10-8. Account and Address
package com.apress.springbatch.statement.domain;
import java.math.BigDecimal;
import java.util.List;
public class Account {
private long id = -1;
private String accountNumber;
private Customer cust;
private BigDecimal cashBalance;
private PricingTier tier;
private List<Transaction> transactions;
 
Search WWH ::




Custom Search