Class Account
- java.lang.Object
-
- ejava.examples.orm.inheritance.annotated.Account
-
- Direct Known Subclasses:
CheckingAccount
,InterestAccount
@Entity public abstract class Account extends Object
This class provides a base class for table-per-class inheritance strategy example. The derived classes will squash the information from this entity within their tables. Note too that since there is no physical base table, something external must be used to create id values or allow the ids of each sub-type to be allowed to be locally generated (thus getting overlaps in id values). The approach taken here was to define a sequence generator.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
deposit(double amount)
double
getBalance()
long
getId()
void
processInterest()
void
setBalance(double balance)
String
toString()
abstract void
withdraw(double amount)
-
-
-
Method Detail
-
getId
public long getId()
-
getBalance
public double getBalance()
-
setBalance
public void setBalance(double balance)
-
deposit
public void deposit(double amount) throws AccountException
- Throws:
AccountException
-
withdraw
public abstract void withdraw(double amount) throws AccountException
- Throws:
AccountException
-
processInterest
public void processInterest()
-
-