Which code, inserted at line 11 of class Booking, is appropriate for his strategy?

Refer to the Exhibit.

A developer wants to have bookingdata stored in the table BOOKING, flightnumber in table FLIGHTBOOKING, and hotel name in HOTELBOOKING.
Which code, inserted at line 11 of class Booking, is appropriate for his strategy?

Refer to the Exhibit.

A developer wants to have bookingdata stored in the table BOOKING, flightnumber in table FLIGHTBOOKING, and hotel name in HOTELBOOKING.
Which code, inserted at line 11 of class Booking, is appropriate for his strategy?

A.
@Joined

B.
@SingleTable

C.
@TablePerClass

D.
@Inheritance (strategy = JOINED)

E.
@Inheritance (strategy = SINGLE_TABLE)

F.
@Inheritance (strategy = TABLE_PER_CLASS)



Leave a Reply 1

Your email address will not be published. Required fields are marked *


Tommy_Croatia_ZGB

Tommy_Croatia_ZGB

D is the correct answer.

Joined inheritance is the most logical inheritance solution because it mirrors the object model in the data model. In joined inheritance a table is defined for each class in the inheritance hierarchy to store only the local attributes of that class. Each table in the hierarchy must also store the object’s id (primary key), which is only defined in the root class. All classes in the hierarchy must share the same id attribute. A discriminator column is used to determine which class the particular row belongs to, each class in the hierarchy defines its own unique discriminator value.