-->
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.  [ 2 posts ] 
Author Message
 Post subject: two suggest for validation
PostPosted: Fri Dec 16, 2005 6:00 am 
Newbie

Joined: Tue Jun 21, 2005 10:44 pm
Posts: 9
1. ignore static field validation, some constant with validation annotaion was validated. I use annotaion for those constant for special purpose.
code modified in ClassValidator:
public ClassValidator(Class<T> beanClass, ResourceBundle resourceBundle, Map<Class, ClassValidator> childClassValidators) {
....
if (!Modifier.isStatic(field.getModifiers())) {//add this line
createMemberValidator(field);
Class clazz = field.getType();
createChildValidator(resourceBundle, field, clazz);
}
....
}

2. validation failure reasons was not reported in exception.
code modifed in ValidateEventListener.java:
protected void validate(Object entity, EntityMode mode) {
...
if ( consolidatedInvalidValues.size() > 0 ) {
throw new InvalidStateException(
consolidatedInvalidValues.toArray( new InvalidValue[consolidatedInvalidValues.size()/* here */] ), entity.getClass().getName());
}
}


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 19, 2005 7:32 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
I'm -1 on 1.
I don't understand 2. toArray will use the array type if not of the right size. The ISE is still filled up

_________________
Emmanuel


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

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.