This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Saving to the database in Uppercase Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Saving to the database in Uppercase" Watch "Saving to the database in Uppercase" New topic
Author

Saving to the database in Uppercase

paul king
Greenhorn

Joined: May 23, 2006
Posts: 12
Hi

I have an application that uses struts, spring and hibernate.
Any suggestions on the best place to set my value object properties to uppercase ready for saving to a database and whats most efficient?
e.g. possibly when the object properties are initially set
or in the service layer
or at dao level
or maybe in the hibernate mapping
or any other ideas???

Thanks in advance
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30580
    
154

Paul,
It's equally efficient wherever you decide to do it. I like the DAO level because uppercase sounds like you are making it uppercase for the database level. If it is more of a business decision, I would do it when the object properties are first set. Whatever you decide, consistency is most important.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
Which of these do you want to print "true" ??

These will be driven by the other ways your system uses these things, I think.


A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
 
GeeCON Prague 2014
 
subject: Saving to the database in Uppercase