Reputation: 257
I'm using Bean Validation to check constraints on my model, but I don't know how to configure it so it only validates when I want it to. I found on that I could put this tag in my persistence.xml
, <validation-mode>NONE</validation-mode>
but it doesn't work.
I appreciate any kind of help.
Upvotes: 2
Views: 2345
Reputation: 2931
I remember that i also had problems with that, here is my working example:
<bean id="entityManagerFactory"
class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="persistenceUnitName" value="punit" />
<property name="jpaPropertyMap">
<map>
<entry key="javax.persistence.validation.mode" value="none"/>
</map>
</property>
</bean>
Upvotes: 4