i want write a mapping File for following Class, but i dont know how.
public class TwoDimHashMap<K1, K2, I> {
private final Map<K1, Map<K2, I>> main;
public TwoDimHashMap() {
main = new HashMap<K1, Map<K2, I>>();
}
...
}
Thx
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Mapping a Map is pretty straightforward in Hibernate. I don’t believe a Map of Maps is possible, and neither is it usually desirable. For example, instead of a Map, it’s usually easier and more expressive to use a Set<Something> where Something is a mapped class with two String properties. Doing it this way is usually a more natural expression of your problem domain, and it’s far easier to write queries on this kind of model than querying into a Map.