-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Mapping Map with Multiple Key Columns Not Working
PostPosted: Wed Dec 31, 2008 1:33 pm 
Newbie

Joined: Wed Dec 31, 2008 1:19 pm
Posts: 1
Location: Madison
Im trying to retrieve instructions based on instruction_type and purpose_type which are two columns on the company_insurance_memo table. Based on these two data points, the instructions for that are retrieved. Here is code snippet.

Code:
@MapKey(columns = {
         @Column(name = "instruction_type"), @Column(name = "purpose_type")
   })
   @OneToMany(fetch = FetchType.EAGER)
   @Cascade(value = org.hibernate.annotations.CascadeType.ALL)
   @JoinTable(name = "company_insurance_memo", joinColumns = {
      @JoinColumn(name = "company_id")
   }, inverseJoinColumns = {
      @JoinColumn(name = "memo_id")
   })
   private Map<Object, Memo> instructions = new HashMap<Object, Memo>();


I turned on the show-sql and it appears to execute the select statement correctly. I took the sql and ran it against my db and it pulled back the correct rows. The problem is that the instructions map doesnt get populate. We tried have the map be an object that contains these two data points and that didnt work. We tried using String as the first part and that didnt work. Object seems to be the only thing that allows my code to run, but the map isnt populated. Any help would be greatly appreciated. Thanks


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.