This week's book giveaway is in the Open Source forum.
We're giving away four copies of Programmers Guide to Apache Thrift and have Randy Abernethy on-line!
See this thread for details.
Win a copy of Programmers Guide to Apache Thrift this week in the Open Source 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 ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

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

 
Ranch Hand
Posts: 1732
12
  • 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
Explanation:
...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: 3272
296
Android Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, you are correct.
 
I am mighty! And this is a mighty small ad:
ScroogeXHTML - small and flexible RTF to HTML converter library
https://coderanch.com/t/710903/ScroogeXHTML-RTF-HTML-XHTML-converter
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!