Java Vibes..

June 22, 2009

Hibernate Inheritance

Hibernate supports different types of inheritance, here we explain it with the help of some examples. Please consider the following structures for the purpose of the examples:

Tables:

payment_t: pmt_id (PK), amount, paid_by, date_time

cash_payment_t: pmt_id (PK), currency

credit_payment_t: pmt_id (PK), cc_no, cc_type

cheque_payment_t: pmt_id (PK), cheque_no

Value objects:

Interfaces:

PaymentVo

Classes:

CashPaymentVo

CreditCardPaymentVo

ChequePaymentVo

(more…)
Advertisements

Create a free website or blog at WordPress.com.