-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Formula Attribute
PostPosted: Thu Jun 21, 2007 1:39 pm 
Newbie

Joined: Thu Jun 21, 2007 9:52 am
Posts: 5
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


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 21, 2007 5:07 pm 
Regular
Regular

Joined: Mon Apr 19, 2004 6:54 pm
Posts: 79
Formula on property is used when an evaluation result is needed, there is no column mapped to this kind of property.

For your need, you can use a custom UserType.
You can have a look to http://www.jasypt.org/, it offers some encrypted usertypes.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.