[hibernate-dev] Annotation name for column-level read/write expression

Emmanuel Bernard emmanuel at hibernate.org
Tue Sep 28 05:29:44 EDT 2010


As of right now, yes.
Trying to support it was not super trivial but I can give it a second round today.

@ReadWriteWrapper would work. We don't use wrapper though in the doc for this feature but that can be changed.


On 28 sept. 2010, at 05:54, Steve Ebersole wrote:

> Is the 'forColumn' attribute required if a single column value?
> 
> 
> On Mon, 2010-09-27 at 22:53 -0500, Steve Ebersole wrote:
>> @Wrapper( 
>>    forColumn="credit_card_num", 
>>    read="decrypt(credit_card_num)",  
>>    write="encrypt(?)"
>> )
>> 
>> @ReadWrapper( forColumn="credit_card_num",
>> expression="decrypt(credit_card_num)" )
>> @WriteWrapper( forColumn="credit_card_num", expression="encrypt(?)" )
>> 
>> 
>> 
>> On Tue, 2010-09-28 at 00:10 +0200, Emmanuel Bernard wrote:
>>> Hey guys,
>>> I've implemented http://opensource.atlassian.com/projects/hibernate/browse/HHH-4510 and committed it. It basically looks like that
>>> 
>>> @Entity
>>> class CreditCard {
>>>   @Column(name="credit_card_num")
>>>   @ReadWriteExpression(
>>>      forColumn="credit_card_num", 
>>>      read="decrypt(credit_card_num)", 
>>>      write="encrypt(?)")
>>>   public String getCreditCardNumber() { return creditCardNumber; }
>>>   public void setCreditCardNumber(String number) { this.creditCardNumber = number; }
>>>   private String creditCardNumber;
>>> }
>>> 
>>> However, I am not super happy about @ReadWriteExpression as a name. @ColumnReadWriteExpression is the most correct name but quite mouthful. 
>>> 
>>> Anybody gets a better idea?
>>> 
>>> Emmanuel
>>> 
>>> _______________________________________________
>>> hibernate-dev mailing list
>>> hibernate-dev at lists.jboss.org
>>> https://lists.jboss.org/mailman/listinfo/hibernate-dev
>> 
> 
> -- 
> Steve Ebersole <steve at hibernate.org>
> http://hibernate.org
> 





More information about the hibernate-dev mailing list