org.hibernate.LazyInitializationException at com.sun.faces.renderkit.html_basic.MenuRenderer.convertSelectManyValuesForModel

While submitting, the JSF UISelectMany components need to create a brand new instance of the collection with the submitted and converted values prefilled. It won’t clear out and reuse the existing collection in the model as that may either get reflected in other references to the same collection, or may fail with an UnsupportedOperationException because … Read more

How do UISelectOne and UISelectMany components preselect defaults in f:selectItems

It uses Object#equals() for that. You can change (fix) this behavior by implementing it accordingly on your entity. private Long id; @Override public boolean equals(Object other) { return (other != null && getClass() == other.getClass() && id != null) ? id.equals(getClass().cast(other).id) : (other == this); } Don’t forget the hashCode() to satisfy the equals-hashCode contract. … Read more