T9 Persistent Objects Flashcards
Describe primary and foreign keys. How do they differ?
A primary key is an attribute or a set of attributes unique identify a record
> Never changing
> Never Null
A foreign key is use to create a relationship between entities in different tables
Unlike primary keys, foreign keys are not
required and do not, necessarily, identify a row uniquely
Describe object-relational mapping.
software layer that mediates between object- oriented languages and relational DBMSs
Identify the class diagram element equivalent to entity classes Class Diagram element > Classes (including Attributes) > Association > Multiplicity
Class attributes become table attributes (or columns).
Associations are mapped by a primary-foreign key
pairs.
Multiplicity is mapped through foreign keys.
what is the major difference between relational modeling and a pure object-oriented database?
Object Orient
> Repeating attributes
> Persistence transparent (separating your application from the database layer)
Rational Database
> No repeating Attributes
> Logical View of Database organisation
Discuss how to overcome ORM incapacity to have generalisation classes
Merging Super and sub classes together. One super class table, If subclass has a variable not related to another sub class, the value is set to 0 • Merging Super and Sub classes together. Multiple sub class tables, Each Sub class has columns relating to the super class • Separating Super and Sub class, Super and sub class are connected by keys