Assume that there is an interface Animal and concrete classes Cat and Dog that inherit…
Jump to turn (15)
- 1Assume that there is an interface Animal and concrete classes Cat and Dog that i
- 2So, true or false (answer with only one word): Hibernate cannot give all Animals
- 3Explain why (in up to four sentences).
- 4So, you should have said "True.", not "False.", right?
- 5What if there is a List as a field in Dog? How would that work, especially with
- 6What if the list is of a primitive data type?
- 7What if the List's size is unknown at compile time?
- 8Is there a way to do this without creating a DogAttribute class?
- 9Give me the total code (and explain all the annotations in the comments).
- 10Re-do your answer, but this time, use UUIDs.
- 11What does the 2 in uuid2 mean?
- 12So, re-do the previous answer with UUID 4.
- 13Is it possible to use uuid4 instyead of uuid-char instead?
- 14Will everything, including the dog attributes use UUID 4?
- 15Re-do the initial code request with all my new requests, including to make the d
- User
Assume that there is an interface Animal and concrete classes Cat and Dog that inherit from Animal.
Assuming I want to query all Animals (and also that Animal is an interface, not a partially abstract or concrete class),
-
would it be possible to query all Animals with the TABLE_PER_CLASS strategy?
-
would it be possible to query all Animals with the JOINED strategy?
-
- Assistant
-
With the TABLE_PER_CLASS strategy in object-relational mapping (ORM), each concrete class (such as Cat and Dog) will have its own separate table in the database. Since Animal is an interface and interfaces cannot be directly instantiated or mapped to a database table, it would not be possible to query all Animals using the TABLE_PER_CLASS strategy.
-