File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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 | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to define password column in hibernate
 
Similar Threads
MySQL - add and remove username from table
Problem in mapping
Help HIGHLY needed with one-to-one mapping error
Hibernate Many to Many association does not update database
Sequence increment does not match its pre-allocation size.