Friday, May 8, 2009

Hibernate Gotcha #215

I was getting this error when using session.createSQLQuery():

"More than one row with the given identifier was found."

No searching on the interwebs helped at all.

I have an entity that looks like this:

public class Pornstar
 PornstarArea area;
 public PornstarArea getArea() { return this.area; }
 public void setArea(PornstarArea area) { this.area = area; }

PornstarArea is another entity object.

I randomly removed the @JoinColumn and it made that error stop happening. Go figure.

No comments: