-->
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.  [ 3 posts ] 
Author Message
 Post subject: Being able to format a columns name
PostPosted: Thu Apr 21, 2005 9:52 am 
Beginner
Beginner

Joined: Tue Apr 19, 2005 9:39 am
Posts: 45
Hi,
I am new to Hibernate and I was wonder if it was possible to be able to set some meta data to a column of a table.

Lets say I have a table Shoe and it has a column shoe_lace, I want to be able to retrieve a "clean cut" name for that column such as 'Shoe Lace'.

Also I want to be able to go from 'Shoe Lace' to shoe_lace so it is possible to construct a query.

The purpose is becase we are creating a basic report that allows the user to select any column in the table (being the information that want returned from the query) but the problem is we need the column names pretty for the user.


Any help would be great.

Brandon


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 21, 2005 9:59 am 
Expert
Expert

Joined: Sat Oct 25, 2003 8:49 am
Posts: 490
Location: Vrhnika, Slovenia
See what NamingStrategy interface can do for you.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 21, 2005 10:15 am 
Beginner
Beginner

Joined: Tue Apr 19, 2005 9:39 am
Posts: 45
That seems do give a standard for creating tables...abstracting out the configuration file...


I just want to be able to map a column name that already exists to a readable human format.


shoe_lace ==== Shoe Lace


Problem is that it is not good to have spaces in column names in a DB. Is that right? Do you know another workaround ?


Brandon


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