• Post Reply Bookmark Topic Watch Topic
  • New Topic

Formula Attribute  RSS feed

 
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: 17309
11
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
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!