-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Very strange effect with hibernate validatior
PostPosted: Mon Jun 14, 2010 12:49 am 
Newbie

Joined: Thu Sep 24, 2009 1:13 am
Posts: 2
Hi!

I have a simple request:

If I persist a Company class (via EntityManager) it throws a javax.validation.ConstraintViolationException

which is O.K. (@Length to short, works if @Length of attribute is O.K.)!

But with:

Code:
ValidatorFactory factory = Validation.buildDefaultValidatorFactory();
Validator validator = factory.getValidator();
validator.validate(company);


I can get errors. All errors on the attribute (length is to short AND length is to long - even if the length is valid). I am to dumb to understand this behaviour...

Can anybody explain me what's going on there? Or is there a real example (Spring 3 / Hibernate / JPA with annotations) around?

Thank you very much in advance!

Regards,
Anton


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.