Hibernate 4 ClassCastException on LAZY loading while EAGER works fine
问题 I have the following JOINED inheritance root entity for geographic areas (like continents, countries, states etc.): @Entity @Table(name = "GeoAreas") @Inheritance(strategy = InheritanceType.JOINED) public abstract class GeoArea implements Serializable { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column protected Integer id; @Column protected String name; @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "parent_id", referencedColumnName = "id") protected GeoArea parent; ...