-->
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: Information available in ClassMetadata
PostPosted: Wed Oct 27, 2004 10:31 am 
Newbie

Joined: Thu Oct 21, 2004 10:45 am
Posts: 11
I was wondering if it would be possible to make more information available in the ClassMetadata class, such as the property's column length, or all the columns if more than one associated with a property. This way, the app could validate the length of a string before it was submitted to the database.

In a similar vein, it would be nice if we could define our own metadata that could be accessed through the ClassMetadata too. Then, for example, you could add a regular expression for a property, which could be used on a Web page to do client-side Javascript validation.

Obviously this is a pretty specific suggestion, but a flexible metadata api would allow users to extend the mapping file to suit their purposes.

Just a thought.

Digby


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 27, 2004 7:38 pm 
Pro
Pro

Joined: Tue Aug 26, 2003 8:07 pm
Posts: 229
Location: Brisbane, Australia
Look at the meta attribute in the reference doco. It does precisely what you want.

In fact, we use it (among other things) for exactly what you are talking about, validating string lengths before putting them in the DB.

This topic provides a little more info: http://forum.hibernate.org/viewtopic.ph ... light=meta

_________________
Cheers,
Shorn.


Top
 Profile  
 
 Post subject: Cool. Thanks
PostPosted: Thu Oct 28, 2004 6:40 am 
Newbie

Joined: Thu Oct 21, 2004 10:45 am
Posts: 11
You're right. That's exactly what I want.

I was getting misled down the Classmetadata route, rather than the PersistentClass route.

There must be something Hibernate doesn't do!! ;-)


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 29, 2004 1:57 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
I haven't been able to make coffee with it...

_________________
Max
Don't forget to rate


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.