validation « EntityManager « JPA Q&A

1. Validation doesn't work on EntityManager.merge()

I have few validations on my entity, like @NotNull, and some generation, like

@GeneratedValue(strategy = AUTO)
@Column(name = "ID")
private Long id;

@GeneratedValue(strategy = GenerationType.AUTO)
private Long referenceNumber;
However when calling EntityManager.merge() this values are not ...

2. Hibernate validator and hibernate entitymanager conflict

Hi, I use glassfish 2.1 in my developer environment and for the moment I develop an jsf-ejb-hibernate application. I didn't find any solution to specify "parent-last" for the classloader and for this reason there are some conflicts between jars which are imported as dependencies by the Hibernate Validator 4.0.1 GA and Hibernate entity manager 3.4.0 GA. I want to use Hibernate ...