Retrieving Objects
On the database server side object retrieval results in a more
expensive operation: A query for root class instances
ofinherit.joined.v1.BillingDetails
❶ of our inheritance hierarchy
results in joining all three tables BillingDetails
❶, BankAccount
❷ and CreditCard
❸:
Java |
|
Sql |
|
No. 22
JPA constraints and database integrity.
Q: |
Explain all integrity constraints of the Hibernate generated schema. Will it implement the constraints corectly on database level corresponding to the inheritance related Java™ objects? On contrary: Are there possible database states which do not correspond to the domain model's object constraints? |
||||||||
A: |
We take a look to the database schema:
The NOT NULL constraints implement their counterpart properties in the corresponding Java™ objects. The mapping does not cover one important integrity
constraint of our domain model: The base class
So the current database schema actually refers to a
domain model having a concrete base class
|
No. 23
Implementing figures by joined subclasses
Q: |
Implement the model being given in Figure 945, “Figure subclasses” by joined subclasses. |
A: |
See
|