Win a copy of JDBC Workbook this week in the JDBC and Relational Databases forum
or A Day in Code in the A Day in Code forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
  • Piet Souris
  • salvin francis
  • fred rosenberger

My exam cloud mock 4, about how many tables for JOINED strategy

Ranch Foreman
Posts: 1896
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Consider the following entity class hierarchy:
public abstract class PaymentCard{}
public class CreditCard extends PaymentCard{}
public class DepitCard extends PaymentCard{}
Assuming that JOINED is used as inheritance strategy, and all the three classes are Entity classes, which of the
following is correct?
A. Two tables, one for CreditCard and one for DepitCard will used.
B. Three tables one for each class will be used.
c. JOINED is an invalid strategy for this scenario.
D. Only one table will be used.
Correct answer : A
...In JOINED, there is a table for each class. However, tables for subclasses contain only those fields that are specific to those classes.

I think the answer should be B. One table for PaymentCard, one table for CreditCard, one table for DepitCard.
PaymentCard table has the common fields/properties mapped to PaymentCard entity.
CreditCard table and DepitCard table have specific fields/properties mapped to CreditCard entity and DepitCard entity.
Also CreditCard table and DepitCard table have foreign key constraint refering to the primary key of PaymentCard.
Creator of Enthuware JWS+ V6
Posts: 3339
Android Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, you are correct.
mooooooo ..... tiny ad ....
Devious Experiments for a Truly Passive Greenhouse!
    Bookmark Topic Watch Topic
  • New Topic