Question

I checked below article and try to implement something similar but failed. How to use Hibernate @Any-related annotations?

I have 2 questions: 1- Are those Book, VHS and DVD classes are entities that map "BORROW" table. Examples codes of these classes would be useful. 2- When I tries, I successfully get the correct object type, but values were empty. I tried Hibernate.initialize, due to lazy fetch, I see that it also bring some date but couldn't populate that data to object.

Am I doing something wrong?

Thanks for your help...

Was it helpful?

Solution

  1. Book, VHS and DVD are normal entities. They do not have to reference the Borrow at all
  2. You shouldnt be able to see emtpy data at all. this can have several causes:

    • there is no data in database
    • hibernate is not able to set the properties but this should throw an exception
    • the properties are not mapped correctly
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top