title: Bean validation not working until JPA entity is merged
body: <p>When the backing bean of the Facelet invokes <code>setLastName("Test!!!")</code> no ConstraintViolationException is thrown, although the non-alpha chars are clearly present in the method argument.  </p>
  
  <p>I set a breakpoint to verify that setLastName was being invoked and I observed the JPA entity's lastName value change.  Validation should fail immediately, yes?  It's not.</p>
  
  <p>Later, when it's time to persist the changes, when EntityManager#merge is invoked, the ConstraintViolationException is thrown.  </p>
  
  <blockquote>
    <p>List of constraint violations:[
    ConstraintViolationImpl{interpolatedMessage='error.spacesandletters',
    propertyPath=lastName, rootBeanClass=class
    foo.bar.business.model.entity.authenticate.User,
    messageTemplate='error.spacesandletters'}]</p>
  </blockquote>
  
  <pre><code>private String lastName;
  
  @Column(name="lastname", nullable=false, length=40)
  @Size(max=40)
  @NotNull
  @Basic(optional=false)
  @Pattern(regexp="[A-Za-z ]*", message="error.spacesandletters")
  public String getLastName() { return this.lastName; }
  
  public void setLastName(String lastName) { this.lastName = lastName; }
  </code></pre>
  
  <p>So I know that validation is available and that it is working at JPA pre-persist.  But for some reason it's not working at the moment User#setLastName is first invoked via the backing bean.  What am I doing wrong?</p>
  
  <p>EDIT #1:</p>
  
  <p>I should have mentioned that my ChangePasswordBean works just fine with the following two custom annotations.  </p>
  
  <pre><code>@NotEmpty @Password private String password1;
  @NotEmpty @Password private String password2;
  </code></pre>
  
  <p>But in this case the backing bean's fields are annotated.  Whereas in the example above the backing bean is pointing to the JPA entity whose getters are annotated.</p>
  
  <p>EDIT #2:</p>
  
  <p>After reading BalusC's reference to <a href="https://stackoverflow.com/questions/25264868/bean-validation-skipped-on-cdi-managed-jsf-controller/">this other question</a> in which he was thinking that the problem might be related to a <a href="https://java.net/jira/browse/JAVASERVERFACES-3183" rel="nofollow">known Mojarra bug that was fixed in v. 2.2.7</a> I upgraded to Mojarra 2.2.8-01.  Here's the entry in the Wildfly startup log:</p>
  
  <blockquote>
    <p>17:41:51,965 INFO  [org.jboss.as.jsf] (ServerService Thread Pool -- 38) JBAS012615: Activated the following JSF Implementations: [mojarra-2.2.8-01, main]</p>
  </blockquote>
  
  <p>Unfortunately, the problem I've described has not gone away.  Bean validation annotations on the JPA entity are not working whereas bean validation annotations on the JSF managed bean are working.</p>