Class 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.

    • Field Detail

      • id

        private long id
      • balance

        private double balance
    • Constructor Detail

      • Account

        public Account()
      • Account

        public Account​(long id)
    • Method Detail

      • getId

        public long getId()
      • getBalance

        public double getBalance()
      • setBalance

        public void setBalance​(double balance)
      • processInterest

        public void processInterest()