Ok, I got it working.  I was not outjecting the department or departmentSection 
entities which was a problem.

I also had to rewrite the equals() method of DepartmentSection

public boolean equals(Object other) {
  |     if (other == null) {
  |     return false;
  |     } 
  |     if (other instanceof DepartmentSection) {
  |     DepartmentSection that = (DepartmentSection) other;
  |     if (that.getDepartmentSectionId() != null && 
this.getDepartmentSectionId() != null) {
  |         return this.departmentSectionId.equals(that.departmentSectionId);
  |     } else {
  |         return (this == that);
  |     }
  |     } else {
  |     return false;
  |     }       
  | }

Since jsf does not guarantee how many times equals() will be called, it was 
being called 3 times during process validations but it was passing null objects 
in for "other" and at other times seam was passing proxy objects that were not 
null but the fields were not initialized.  

Is there a more concise way to cover all the bases with equals()?  Or should 
implement a similar method on all my entities?

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

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4079695
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to