Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Formula Attribute

 
chinna sankar
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Before inserting card number into database, I need to perform encryption using below formula.

In Mapping I did like below

<property name="card_number" formula="(select tcrypt.tencrypt(card_number) from dual)" >
<column name="CNUMBER"/>
</property>


In the bean
Creditcard cardobj = new Creditcard();
cardobj.setCard_type("VISA");
cardobj.setCard_number("234509873333");


It is inserting null value.

Please suggest me where I am doing mistake.

Thanks in Advance
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would not make it a select statement, just "tcrypt.tencrypt(card_number)"

Mark
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic