I am building a web application using Spring 3.1.0.RELEASE, JSF 2.x, JPA 2 with the Hibernate provider. The application runs on Tomcat 6.X.
I use bean validation in my entities. Hibernate Validator - provider, version 4.2.0.Final.
@NotEmpty(message="{site.checklangs}") @OrderBy("position ASC") @OneToMany(mappedBy = "site", fetch = FetchType.EAGER, cascade= CascadeType.ALL, orphanRemoval=true) private List<SiteLanguage> langs;
@NotEmpty
works persist
, but not for merge
@Override @Transactional public Site updateSite(Site site) { return entityManager.merge(site); }
This throws exceptions when my list is empty. What for? How to fix it?
source share