-->
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.  [ 2 posts ] 
Author Message
 Post subject: convert char or int value to String
PostPosted: Thu Aug 16, 2007 8:46 am 
Beginner
Beginner

Joined: Wed Jul 25, 2007 6:32 am
Posts: 22
How can I convert a char or int value into a String?

For example:

I have a table "USER" which has a column "ACTIVE" (Y/N), but could also be 0 or 1.

My Domain object User has a String property "active".

But in my jsf view page I want to display "Yes" or "No" instead of "Y" or "N"

What is the best way to do this?

Is it better to translate the column values directly to "Yes" or "No" when the User Object is filled by Hibernate. And how do I do this?

Or is it better to translate the "Y" and "N" in the User Object in my View to the desired format?

Can someone tell what is the best way, and how to do it?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 16, 2007 9:35 am 
Expert
Expert

Joined: Fri Aug 19, 2005 2:11 pm
Posts: 628
Location: Cincinnati
make it "Yes" or "No" in the presentation layer. Keep the data the actual 0 or 1, simple

_________________
Chris

If you were at work doing this voluntarily, imagine what you'd want to see to answer a question.


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