-->
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.  [ 9 posts ] 
Author Message
 Post subject: Bean validation
PostPosted: Mon Jan 19, 2004 9:28 am 
Newbie

Joined: Mon Jan 19, 2004 9:20 am
Posts: 5
Hello,

I have a big problem trying to validate a bean before i call save it.

My problems is that I didn't find any class/method where I can get complete bean property information, as field length and if is nullable.

ClassMetadtaa offers information about available properties and the properties Type class. Column class offers information only about DB field name, so I cannot link those classes together to obtain all the information I need.

Any help is welcome.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 19, 2004 10:26 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Use the Validatable interface

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 19, 2004 10:29 am 
Newbie

Joined: Mon Jan 19, 2004 9:20 am
Posts: 5
Thanks, but no thanks.

This Validatable doesn't offer any metadata information. This means I must hardcode validation parameters in each bean, and I dont want to keep in sync all the time this validation info with the XML definition file.

I want to know at runtime all the informations form a <property> tag (of course without parsing the definition file myself.

Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 19, 2004 10:32 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
OK, does the meta tag fits your needs (don't asked me info, I've never used it).

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 19, 2004 10:37 am 
Newbie

Joined: Mon Jan 19, 2004 9:20 am
Posts: 5
No, to complicate because I must manage normal definition and this metadtata information.

There is no other way?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 19, 2004 10:39 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
xdoclet tags and java generation that fits your needs. You need to do it yourself however

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 19, 2004 10:40 am 
Newbie

Joined: Mon Jan 19, 2004 9:20 am
Posts: 5
:) No.

Ok it seems neccessary to load myself the XML file to build my metadata information.

Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 19, 2004 11:31 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
You can get some Metadata by using SessionFactory.getClassMetadata

Don't know if that helps you


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 19, 2004 1:04 pm 
Newbie

Joined: Mon Jan 19, 2004 9:20 am
Posts: 5
No, is not enought. Thanks.


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