aspose file tools
The moose likes Object Relational Mapping and the fly likes how to define password column in hibernate Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Object Relational Mapping
Reply Bookmark "how to define password column in hibernate" Watch "how to define password column in hibernate" New topic
Author

how to define password column in hibernate

kwame Iwegbue
Ranch Hand

Joined: Sep 02, 2000
Posts: 197
Does anyone know how to annotate a class or define in a hbm.xml file, an element that produces a password column- providing for encryption, (using hibernate3.2) similar to writing the following statement in SQL:



and then the following would insert encrypted password:



Thanks!!

The problem i'm having is with the PASSWORD() function. I can't seem to find its equivalent in hibernate or JPA
[ May 09, 2007: Message edited by: kwame Iwegbue ]

Who dares, wins! (SAS motto)
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

"password" data type? Which database are you using? Sounds like a vendor-specific data type, if it is I'd keep this out of the mapping (just use a character type and encrypt the text).

In Hibernate you treat functions like they were named queries. Have a read of the docs on named queries for more info.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
kwame Iwegbue
Ranch Hand

Joined: Sep 02, 2000
Posts: 197
Thanks Paul.
how do I encrypt the text. Its MySQL database
 
 
subject: how to define password column in hibernate
 
Threads others viewed
Problem in mapping
MySQL - add and remove username from table
Help HIGHLY needed with one-to-one mapping error
Sequence increment does not match its pre-allocation size.
Hibernate Many to Many association does not update database
developer file tools

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture