Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) 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: 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
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!