Hibernate: Using complex classes as properties
问题 I am trying to do the following: public class Distance { private Course courseA, courseB; private int minDistance; double cost; private Long id; public Distance() { super(); } public Distance(Course courseA, Course courseB, int minDistance, double cost) { super(); this.courseA = courseA; this.courseB = courseB; this.minDistance = minDistance; this.cost = cost; } @Override public String toString() { return "Distance [courseA=" + courseA + ", courseB=" + courseB + ", MinDistance=" + minDistance