Tried a few things without success.
Code:
public class Course
{
@OneToMany(cascade=CascadeType.ALL)
@JoinColumn(name="course_id", nullable=false)
@ForeignKey(name="course_tees_courses_fk")
@MapKey(name="teeType")
private Map<TeeType, CourseTee> courseTees;
}
Code:
public class CourseTee
{
@ManyToOne(cascade=CascadeType.ALL, fetch=FetchType.EAGER)
//@LazyToOne(value=LazyToOneOption.FALSE)
@JoinColumn(name="tee_type", nullable=false)
@ForeignKey(name="course_tees_tee_types_fk")
private TeeType teeType;
}
TeeType equals and hashcode implemented correctly however map.contains(TeeType.X) always returns false.
Any ideas? Ditch the Map?