1

I have a Java HashMap object that contians a User object and a Room object. Can Hibernate cope with mapping this to a database, or can hibernate only deal with mapping collections that contain objects of the same type?

Many thanks,

Dave.

1
  • unclear question............. Commented Jan 22, 2011 at 14:51

1 Answer 1

3

You may want to create a common supertype for these objects. If you find that the two types do not have common foundation then maybe they do not belong in the same Map. As far as I know, mapping to two distinct types as you describe is not possible.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.