java - Alternatives for @formula annotation or sql decrypt function -


i have issue @formula annotation in hibernate when i'm trying decrypt password column (pwd_col) using key (which retrieved properties file)

the code:

@formula("decrypt(pwd_col, '" + mykeys.decrypt_key + "')") private string mypwd; 

i trying decrypt_key property file.

i getting error:

the value annotation attribute formula.value must constant expression

alternately, there way mimic sql decrypt function in java?

note: please read password field value. eventual purpose of exercise far less important nevertheless needs encrypted.

i know not looking let me give advice store password on database, maybe should change mindset how work passwords.

you should not decrypt passwords on database because security reasons, if lost password should create new one.

to validate login , related tasks should take password form, encrypt , compare encrypted on in database.

if want keep doing in way use @formula valid sql values.


Comments

Popular posts from this blog

IF statement in MySQL trigger -

c++ - What does MSC in "// appease MSC" comments mean? -

javascript - Blogger related post gadget image Resize s72-c [ Need Expert Help ] -