![]() |
|||||||||||||||||
| |
|
|
|||||||||||||||
|
Mapping from Database Table to Java Class Entity - maps the table to the class.
Simple attribute - maps a column in the table to a variable in the class - these store values
Primary key - an entity has an attribute guaranteed to have a unique value for each row - they do not normally appear in an application because the objects are uniquely identified by their reference in memeory Foreign key - a primary key from another entity stored in a column in this entity - serves to identify a relationship between the two identities Relationships Represented by a correspondence between a foreign key column of one table and the primary key column of another table To find which rows are related, you must do a join operation. In the application the relationship is represented by an instance variable.
Which is either a reference to anther enterprise object in a one-to-one
relationship. When you fetch records from a database, EOF executes a join to determine the related records and initialises the instance variables. No SQL is required. In fact it will traverse relationships for you if you need the data from that relaionship. Many to Many relationships Require an additional table in the database which contains columns for the primary keys for both entities.
Resolving these relationships requires two joins.
Simplified in the object model - no class corresponding to the extra join table, unless the join table has its own unique attributes. Flattening relationships When entity A is related to entity B which is related to entity C You want the relationship between A and C
Page updated August 31, 2004
|
||||||||||||||||
|
|
|||||||||||||||||