English 中文(简体)
实体继续登记鉴定员
原标题:Entity persist register validation listener

Im利用JBos 6与Seanm,我有一个试图坚持的实体,User。 我将<代码>org.jboss.seam.framework.EntityHome 提供<编码>UserHome 类别,并高于persist()。 我已用javax详细描述了我的实体类别。 审定说明。 当我为我的实体类别的所有领域提供有效价值时,这个目标始终没有问题。 当我违反其中一项验证限制时,坚持不了预期。

我在坚持不懈期间受到制约的违反问题:藏匿国没有告诉我哪些限制被违反!

javax.validation.ConstraintViolationException: validation failed for classes [com.example.model.User] duringpersist time for groups [javax.validation.groups.Default, ]
at org.hibernate.cfg.beanvalidation.BeanValidationEventListener.validate(BeanValidationEventListener.java:132)
at org.hibernate.cfg.beanvalidation.BeanValidationEventListener.onPreInsert(BeanValidationEventListener.java:71)

如果I force synchronous persistent by additionEntityManager.flush() to UserHome.persist(),那么我可以追捕“ConstraintViolationException和含有所受限制的产出标志。

我的问题:是否有可能为违反限制规定的行为登记一位听众。 我认为,它的一个小小小小小小小小小小小小小小小小话是用来印刷这些侵犯行为,但我希望我能够加入一些法典,以追捕和记录这些违法行为。 否则,我就不知道什么限制被违反。

感谢!

问题回答

暂无回答




相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签