FileDocCategorySizeDatePackage
AccountEntity.javaAPI DocExample1574Wed Aug 23 21:50:50 BST 2000com.imaginary.bank

AccountEntity

public class AccountEntity extends com.imaginary.lwp.BaseEntity implements Account

Fields Summary
private double
balance
private CustomerFacade
customer
private int
number
private AccountType
type
Constructors Summary
public AccountEntity()


        
        super();
    
Methods Summary
public voidcreate(com.imaginary.lwp.Identifier id, AccountType t, CustomerFacade cust)

        prepareCreate(id);
        try {
            number = (int)SequenceGenerator.generateSequence("ACCT_NUM");
        }
        catch( SequenceException e ) {
            throw new TransactionException(e.getMessage());
        }
        type = t;
        customer = cust;
    
public voidcredit(com.imaginary.lwp.Identifier id, double amt)

        prepareStore(id);
        balance += amt;
    
public doublegetBalance(com.imaginary.lwp.Identifier id)

        prepareRead(id);
        return balance;
    
public CustomerFacadegetCustomer(com.imaginary.lwp.Identifier id)

        prepareRead(id);
        return customer;
    
public intgetNumber(com.imaginary.lwp.Identifier id)

        prepareRead(id);
        return number;
    
public AccountTypegetType(com.imaginary.lwp.Identifier id)

        prepareRead(id);
        return type;