T9 Persistent Objects Flashcards

1
Q

Describe primary and foreign keys. How do they differ?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Describe object-relational mapping.

A

software layer that mediates between object- oriented languages and relational DBMSs

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q
Identify the class diagram element equivalent to entity classes
Class Diagram element
     > Classes (including Attributes)
     > Association 
     > Multiplicity
A

Class attributes become table attributes (or columns).
Associations are mapped by a primary-foreign key
pairs.
Multiplicity is mapped through foreign keys.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

what is the major difference between relational modeling and a pure object-oriented database?

A

Object Orient
> Repeating attributes
> Persistence transparent (separating your application from the database layer)
Rational Database
> No repeating Attributes
> Logical View of Database organisation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Discuss how to overcome ORM incapacity to have generalisation classes

A
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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly