-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
Author Message
 Post subject: New To Hibernate
PostPosted: Fri Feb 17, 2006 1:33 pm 
Beginner
Beginner

Joined: Fri Feb 17, 2006 1:28 pm
Posts: 24
Hello,

Im very new to Hibernate. I have a backend MySQL Database which uses AES_ENCRYPT and AES_DECRYPT for certian fields. Does hibernate allow for you to get these encrypted fields returned? And if so, whats needed to be done.?

Thanks,
DM.


Top
 Profile  
 
 Post subject: Re: New To Hibernate
PostPosted: Fri Feb 17, 2006 3:51 pm 
Newbie

Joined: Tue Jan 10, 2006 11:59 am
Posts: 17
DangerMouse wrote:
Im very new to Hibernate. I have a backend MySQL Database which uses AES_ENCRYPT and AES_DECRYPT for certian fields. Does hibernate allow for you to get these encrypted fields returned? And if so, whats needed to be done.?


You can try to use SQL replaces constructions to replace some parts of SQL before it gone to server. So one can translate:

SELECT a.id, a.name FROM table a WHERE a.id=1
to
SELECT a.id, a.name FROM (SELECT b.id id, AES_DECRYPT(b.name, ...) name FROM table b) a WHERE a.id=1

_________________
--
Sergey Vladimirov


Top
 Profile  
 
 Post subject:
PostPosted: Sat Feb 18, 2006 6:30 pm 
Beginner
Beginner

Joined: Tue Sep 09, 2003 9:11 pm
Posts: 32
You could also create a custom UserType that did the encryption/decryption.

http://www.hibernate.org/hib_docs/v3/ap ... rType.html

Chris....

_________________
___________
Chris....
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 21, 2006 4:04 pm 
Beginner
Beginner

Joined: Fri Feb 17, 2006 1:28 pm
Posts: 24
Hey Guys,

Thanks for the replies. I think i am going to try and create Customer tags for required fields


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 13, 2006 7:03 pm 
Newbie

Joined: Thu Apr 13, 2006 6:57 pm
Posts: 3
Hi,

I was able to call the the MYSQL aes_encrypt function for encryption in the <sql-insert> and <sql-update>

http://www.hibernate.org/hib_docs/v3/re ... rysql.html

for decryption i used the aes_decrypt function in the formula tag of the property element.

When i included the formula on the properties element, the <sql-insert> and <sql-update> queries are not called.

It is like either one works, but not both.

Has anybody come across this.

Any help will be greatly appreciated.

Thanks
chandrika


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.