title: Specific Java EJB constraint violation error. Why?
body: <p>I receive this error:</p>
  
  <pre><code>    javax.ejb.EJBException: javax.validation.ConstraintViolationException: Validation
  failed for classes [EntityBeans.PwVersions] during update time for groups 
  [javax.validation.groups.Default, ] List of constraint violations:
  [ ConstraintViolationImpl{interpolatedMessage='size must be between 0 and 45', 
  propertyPath=directory, rootBeanClass=class EntityBeans.PwVersions, messageTemplate='{javax.validation.constraints.Size.message}'} ]
  </code></pre>
  
  <p>at runtime and am frustrated. The problems occurs when I try to cast my query result as a PwVersions object. I need to use the below line of code (or an equivalent) so I would like to know what I would have to change elsewhere (aside from altering the database) to get this to work? Perhaps there is a way to alter the constraint being violated (I am unfamiliar with handling constraints in Java)
  (major/minor are both correct)</p>
  
  <pre><code>PwVersions pwv= (PwVersions)em.createQuery("select pwv from PwVersions pwv where 
  major= :major and minor = :minor").getSingleResult();
  </code></pre>
  
  <p>THANK YOU</p>