-->
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: Annotation based validation in swing layer
PostPosted: Mon Jan 23, 2006 12:03 pm 
Expert
Expert

Joined: Thu Sep 04, 2003 8:23 am
Posts: 368
Hi,

I am playing with the validation part of hibernate annotations and it is very well designed.
I am not interested by the metadata part but I just want to use the validator. My problem is that the validator part is hibernate dependent.
I don't understand why. With this dependency, I must put hibernate jar on the client side and I don't want to do so.

It would be great to split the annotation jar in two parts, one for metadata support and one for the validator framework. This second jar could be made hibernate independent. Thus I could deploy it on the client. More generelly this could open the validator framework to everybody (not only hibernate users)

Does this make sense for you ? Is there anybody else that has the same requirement

Regards

Seb

_________________
Seb
(Please don't forget to give credits if you found this answer useful :)


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 23, 2006 7:06 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Some other people have resquested such a thing, but I'm busy on other priorities. If someone provide a patch, I'll consider it.

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 24, 2006 4:48 am 
Expert
Expert

Joined: Thu Sep 04, 2003 8:23 am
Posts: 368
I went a little bit deeper in the code and it seems to be a difficult task to achieve.

I managed to get only one dependency between validator and hibernate but I can't imagine how to avoid it. In ClassValidator.geInvalidValues, the framework check if a property is initialized before checking validation rules. To do so, it calls the Hibernate.isPropertyInitialized method.

This seems to be a mandatory check on the server to avoid unnecessary initializations during the validation process. So I don't know how to get rid of this dependency

Seb

_________________
Seb
(Please don't forget to give credits if you found this answer useful :)


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 24, 2006 11:35 am 
Expert
Expert

Joined: Tue Oct 05, 2004 9:45 am
Posts: 263
just a quick thought, without kowing the validiator ...

Why not let the user of the validation-fw pass in that dependency? Provide an interface and a default-implementation to do that check (e.g. default always returns 'true').

If someone wants 'Hibernate.isPropertyInitialized' he must provide an own implementation of your interface (e.g. during initialization of the Validator).

Then you don't have that dependency to hibernate and it would be an easy task to provide an own implementation of your interface.

Or design it as a callback or something like this.

gtx
curio


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.