Fix Bug [ 1769579 ] PO.equals comparison wrong for new records

This commit is contained in:
Carlos Ruiz 2007-08-07 18:30:33 +00:00
parent 65f8e8a5e1
commit ef333ae53f
1 changed files with 5 additions and 1 deletions

View File

@ -231,6 +231,10 @@ public abstract class PO
if (!(cmp instanceof PO))
return false;
if (cmp.getClass().equals(this.getClass()))
// if both ID's are zero they can't be compared by ID
if (((PO)cmp).get_ID() == 0 && get_ID() == 0)
return super.equals(cmp);
else
return ((PO)cmp).get_ID() == get_ID();
return super.equals(cmp);
} // equals