我收到此错误:特定的Java EJB约束违规错误。为什么?
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}'} ]
在运行时很沮丧。当我尝试将我的查询结果转换为PwVersions对象时,会出现问题。我需要使用下面的代码行(或者相当的代码),所以我想知道我需要在其他地方更改(除了更改数据库)以使其起作用吗?也许有一种方法来改变约束被侵犯(我不熟悉Java中处理约束) (主要/次要都是正确的)
PwVersions pwv= (PwVersions)em.createQuery("select pwv from PwVersions pwv where
major= :major and minor = :minor").getSingleResult();
THANK YOU
请显示PwVersions实体。 – atamanroman 2013-03-01 18:50:35