2008/4/30 Andri Bratakusuma <[EMAIL PROTECTED]>:
> Kl pas click tombol save untuk data yg mau gw update ada Exception ky gini :
> "NonUniqueObjectException:  a different object with the same
> identifier value was already associated with the session"

Ini related kalo equals dan hashcode nggak di implement properly.

Coba add ini method di User object.
<code>
public boolean equals(Object object)
{
    if (this == object)
    {
        return true;
    }
    if (!(object instanceof User))
    {
        return false;
    }
    final User that = (User)object;
    if (this.id == null || that.getId() == null || !this.id.equals(getId()))
    {
        return false;
    }
    return true;
}

public int hashCode()
{
    int hashCode = 0;
    hashCode = 29 * hashCode + (id == null ? 0 : id.hashCode());

    return hashCode;
}
</code>

Regards,
Edward Yakop

Kirim email ke