openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Saibabu Vallurupalli <saibabu.vallurupa...@gmail.com>
Subject Re: Encryption and Decryption
Date Thu, 07 Jul 2011 20:20:31 GMT
Hi Kevin,

Thank you for the prompt response. I am sure the below workaround should
work for me.
Where do I need to add these LifeCycle callbacks? I have a model class in
James source for the field I am trying to Encrypt/Decrypt as shown below:

*********
public class JPAMessage extends AbstractJPAMessage {

    /** The value for the body field. Lazy loaded */
    /** We use a max length to represent 1gb data. Thats prolly overkill,
but who knows */
    @Basic(optional = false, fetch = FetchType.LAZY)
    @Column(name = "MAIL_BYTES", length = 1048576000, nullable = false)
    @Lob private byte[] *body*;

// methods related to this class getter and creator...here...
}
********

"body" is the attribute I have to work with. So, Is this correct location to
add these life cycle methods?

Please advice.

Thanks,
Sai


On Thu, Jul 7, 2011 at 2:56 PM, Kevin Sutter <kwsutter@gmail.com> wrote:

> Hi Sai,
> JIRA openjpa-763 is a new feature request.  Nobody has found the time to
> dive into this request.  It probably is not that difficult to architect and
> implement -- it's just a matter of time.
>
> As the text of the JIRA indicates, you could do a poor-man's implementation
> by using the LifeCycle callbacks [1].  During the prePersist and preUpdate
> callbacks, you could encrypt the contents of the mail message.  And, during
> the postLoad callback, you could decrypt the contents of the mail message.
> Would that work for your situation?
>
> Thanks,
> Kevin
>
> [1]
>
> http://openjpa.apache.org/builds/latest/docs/manual/manual.html#jpa_overview_pc_callbacks
>
> On Thu, Jul 7, 2011 at 9:05 AM, Saibabu Vallurupalli <
> saibabu.vallurupalli@gmail.com> wrote:
>
> > Hi,
> >
> > I am using Apache James and we have a requirement to Encrypt and Decrypt
> > the
> > email message body while storing to Database. In this process, I started
> > exchanging emails with James development team and they have pointed me to
> > the JIRA ticket# OPENJPA-763.
> > It will be really helpful if this issue can be fixed or please advise me
> > with some suggestions on how to handle column level
> Encryption/Decryption.
> >
> > Thank you,
> > Sai
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message