Does hibernate allow mixing table-per-class hierarchy and table-per-subclass strategies?

  1. Yes

  2. No

  3. Can't say

  4. None of the above


Correct Option: B

AI Explanation

To answer this question, you need to understand the table-per-class hierarchy and table-per-subclass strategies in Hibernate.

In Hibernate, there are different strategies for mapping inheritance relationships between classes and database tables. The table-per-class hierarchy strategy maps the entire inheritance hierarchy to a single table, using additional columns to differentiate between different subclasses. On the other hand, the table-per-subclass strategy maps each subclass to its own table, with the common attributes in the superclass being duplicated in each subclass table.

Now, let's go through each option to understand why it is correct or incorrect:

Option A) Yes - This option is incorrect because Hibernate does not allow mixing the table-per-class hierarchy and table-per-subclass strategies. You have to choose one strategy for the entire inheritance hierarchy.

Option B) No - This option is correct. Hibernate does not allow mixing the table-per-class hierarchy and table-per-subclass strategies.

Option C) Can't say - This option is incorrect because it is possible to determine whether Hibernate allows mixing these strategies or not.

Option D) None of the above - This option is incorrect because the correct answer is B) No.

The correct answer is B) No. This option is correct because Hibernate does not allow mixing the table-per-class hierarchy and table-per-subclass strategies.

Find more quizzes: