I've solved my problem. I now optionally set a locale object on my base DAO
class. If the locale is not null, I add a PBLifeCycleListener to add the
locale to my VO object after a lookup. Then in my VO object, I have
functions like:
public String getName()
{
String returnValue = "!!!LOCALE NOT SET!!!";
if(Locale.ENGLISH.equals(locale))
returnValue = this.nameE;
else if(Locale.FRENCH.equals(locale))
returnValue = this.nameF;
return returnValue;
}
This will let me add other languages to my database tables without having to
change my view components.
Cheers,
Graham
-----Original Message-----
From: Graham Lounder [mailto:[EMAIL PROTECTED]
Sent: January 27, 2004 4:44 PM
To: [EMAIL PROTECTED]
Subject: DB Localization
Hey All,
What is the easiest way to get a Locale object on each object generated by
OJB? I'm planning on adding a getter and setter for the locale object, but
I need to be able to "set" the locale on each query result.
Basically I've got fields like NAME_E and NAME_F for english and french and
I want to be able to make a generic getName that returns the correct name.
Any ideas of what OJB can do to help me? I noticed a couple of attributes
on the class-descriptor that might help me ...
initialization-method CDATA #IMPLIED
factory-class CDATA #IMPLIED
factory-method CDATA #IMPLIED
Cheers,
Graham
Graham Lounder - Java Developer
Spatial Components Division
CARIS www.caris.com
Tel: +1-506-458-8533 Fax: +1-506-459-3849
CARIS has expanded to new office facilities. Our new mailing address is:
115 Waggoners Lane, Fredericton, New Brunswick, E3B 2L4, Canada.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]