-
Nov 22nd, 2010, 05:06 PM
#1
Spring, Hibernate, and aes_encrypt function in MySQL
Hi all,
Spring and Hibernate provided the way to insert a record into database via the save() method.
Ex:
User() user = new User(int id, String name);
userDAO.save(user);
which is great.
However I am stuck at this:
I need to execute this query to insert a record to the table user
SQL query: "insert into user values("My name", AES_ENCRYPT("clear_txt", "key"));
Just for example: My table user has two fields: 'name', and 'password'. The password needed to encrypt with some key. AES_ENCRYPT is a function in MySQL.
How do I do this the Hibernate way?
I had looked around and seem like Hibernate doesn't has the insert query.
If this is not the right way to do it, how do you deal with a requirement to encrypt a field in database with provided key?
Thanks in advance,
Thai
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules