Hi,
when I use a selfreference Hibernate fails with a StackOverflowError.
My code is:
Code:
@Entity
public class Ingredient {
@Id @Hidden
@GeneratedValue(generator="system-uuid")
@GenericGenerator(name="system-uuid", strategy = "uuid")
@Column(name="ID")
private String oid;
@Length(max=40) @Required
private String name;
@ManyToOne(fetch=FetchType.LAZY)
@JoinColumn(name="PARTOF")
private Ingredient partOf; // The failed reference
// Setters and getters
Any time that I want ot access to a object of type Ingredient using the EntityManager a StackOverflowError is produces without stacktrace (and I have put ALL log level for Hibernate).
Hibernate version: Hibernate 3.2.4.sp1, Hibernate EntityManager 3.3.1.GA and Hibernate Annotations 3.3.0.
Does Hibernate JPA implementation support selfreferences ?
Maybe ss this a Hibernate bug ?
or am I missing something ?
Thank you in advance