[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - Re: Exception Caused by: org.hibernate.QueryException: could

Gizdek do-not-reply at jboss.com
Fri Dec 15 14:24:07 EST 2006


I solved the problem, removing the second @Id (gid) annotation inside the User2SecondaryGroup class fixed the problem.

now it looks like

private Integer uid;
	private Integer gid;
 	
	public User2SecondaryGroup() {
	}
	
	@Id
	@NotNull
	public Integer getUid() { 
		return uid;
	}
	
	public void setUid(Integer uid) {
		this.uid = uid;
	}


	@NotNull
	public Integer getGid() { 
		return gid;
	}
	
	public void setGid(Integer gid) {
		this.gid = gid;
	}
	
	
	@Override
	public boolean equals(Object other) {
		if (other == null || !(other instanceof User2SecondaryGroup)) {
			return false;
		}
		User2SecondaryGroup otherUser2SecondaryGroup = (User2SecondaryGroup) other;
		return (this.getUid().equals(otherUser2SecondaryGroup.getUid()) && this.getGid().equals(otherUser2SecondaryGroup.getUid()));
	}
	

public String toDebugString() {
		return "User2SecondaryGroup (" + getUid().toString() + " " + getGid().toString() + " )";
	}
}

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3994325#3994325

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3994325



More information about the jboss-user mailing list