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