1
2
3
4
5
6
7
Objects present in Thread A and Thread B refer to a same row in RDBMS, but from java perspective they are not identical.
8
A class should be of the right granularity, it shouldn’t be too big or too tiny. Classes should be specialists. They should do the kinds of behaviors that a thing of that type should do, and no more. For example, suppose you have a Kitchen class that does all sorts of Kitchen things. Like Oven things and Refrigerator things, etc. So now you’ve got Kitchen things (Kitchen being a room) and Refrigerator things and Oven things all in the same class. That’s three different things. So rather than having the Kitchen class include all the code for Refrigerator and Oven behaviors, have the Kitchen class use a Refrigerator and Oven in a HAS-A relationship. This keeps all three classes simple, and reusable.
9
User-Defined-types (UDT) is an object-relational extensions. The SQL standard supports user-defined datatypes, but poorly. Use of UDTs or Java types inside an SQL database isn’t common practice in the industry at this time. Oracle definition for UDT: A UDT is a serializable Java class whose instances are stored in columns. The class must implement the java.io.Serializable interface.
10
To make bi-directional declare a reference of Customer in class Address as shown: public class Address { ‌.. private Customer customer; ‌. }
11
Database supports mapping the entire hierarchy to a single table or each class to its own table or each concrete class to its own table. This concept is explained in detail in Hibernate and Inheritance.
12
13
14
The common metadata will be in the form of XML/annotations. POJO: Plain Old Java Object. A simple java bean.
15
Dirty checking: Lazy association: Cache:
16
17
ASF: Apache Software Foundation.
18
19
20
21