posted 18 years ago
It is normal to not understand the Hibernate Reference when you are learning Hibernate. But once you get better it will be very useful to you.
It means
table cat(
id
mate_id refenceres (id) from table cat (self reference)
)
So, search from the table cat every cat with name =? and return the mate of this cat.
List mates = sess.find(
"select mate from Cat as cat join cat.mate as mate " +
"where cat.name = ?",
name,
Hibernate.STRING
);
Regards Sebastian
Things get always more complicated as expected.<br />Author of eBook Hibernate 3 Developer Guide by example<br />Tutorials about Hibernate, EJB, Struts, JSF <a href="http://www.laliluna.de" target="_blank" rel="nofollow">www.laliluna.de</a>