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

android - How to save instance state of selected radiobutton on menu -

python 3 IndexError: list index out of range -

IF statement in MySQL trigger -