A JSF Validation Error means that the values of one or more of the controls on the form are invalid. The best way to get details on what item(s) are invalid is to add one of these to the form:
Also, be sure to define explicit (and unique!) "id=" attributes on all the form controls, because the automatically-generated defaults are hard to make sense of.
There are ways to extend the validation framework into things like ORM systems, but those sorts of validations are to permit an ORM model entity to inform JSF that validation should check for values that are null, out of range, or otherwise superficially invalid. Validation cannot check for things that are semantically invalid (such as "color cannot be blue if model=basic"). A fault in the ORM equals() method would never trigger a validation exception.
Incidentally, I have no idea how this statement could even compile:
Since as far as I know, there's no "Objects" class in core
Java.
The more usual implementation looks like this:
I broke my rule on always including braces for brevity. That particular comparison, of course, only works if "id" is a class object. If "id" is a primitive, then it's
If you managed to have "this.id" be a class object and "other.id" to be a primitive, something would be really wrong.