-->
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.  [ 4 posts ] 
Author Message
 Post subject: ClassValidator + EJB3 Annotations
PostPosted: Thu Feb 02, 2006 8:06 pm 
Newbie

Joined: Mon Jan 16, 2006 4:33 am
Posts: 11
Any chance of getting ClassValidator to validate EJB3 annotations in addition to the Hibernate validation-specific annotations?

So for example if you annotate a field with @Column( nullable = false ), it validates the same as if you annotated it with @NotNull. I'm in the middle of adding validation to all my domain objects, and my DRY radar is going nuts...


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 08, 2006 1:54 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Do it the other way around
Code:
@NotNull
@Column(name="blah")


will create a not null column

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 28, 2006 5:43 pm 
Newbie

Joined: Thu Dec 28, 2006 5:24 pm
Posts: 14
As a rule of thumb, I find it best to follow the standard, when one exists. I know that Hibernate's @NotNull existed before @Column, but if Hibernate bills itself as the premiere JPA implementation, I would think that it makes sense to consider the @Column's nullable value. (I would be concerned that some future JPA tools may pay attention to @Column, and ignore non-standard annotations like @NotNull.)

Back to the original question, "Why can't ClassValidator validate EJB3 annotations in addition to the Hibernate validation-specific annotations?"


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 04, 2007 7:44 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
because when using a mix of ORM.xml and annotations, you are stuck

_________________
Emmanuel


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.