Saibabu - I'll put together a small example of how to use @Externalizer / @Factory with JASYPT sometime here this morning.
Thanks, Rick On Mon, Jul 11, 2011 at 7:58 AM, Saibabu Vallurupalli < [email protected]> wrote: > Hi Pinaki, > > Good morning. > I tried the approach of using @Externalizer annotation as below and got an > error says @Externalizer can be only used for methods not for fields. Then > I > have gone through the documentation and found I should be using > @ExternalValues and after using I started getting error as below: > > *********** > Caused by: <openjpa-2.1.0-r422266:1071316 fatal user error> > org.apache.openjpa.p > ersistence.ArgumentException: The field > "org.apache.james.mailbox.jpa.mail.model > .openjpa.JPAMessage.body" cannot use the external-values property. External > valu > es can only be declared for fields of primitives, primitive wrappers, or > strings > . > at > org.apache.openjpa.meta.FieldMetaData.transform(FieldMetaData.java:15 > 38) > ********** > > Can you please advise me where I am going wrong. > > Thank you, > Sai > > On Fri, Jul 8, 2011 at 4:57 PM, pvalluri <[email protected] > >wrote: > > > Hi Pinaki, > > > > Yes, This is really easy and cool. I am still in process of setting up my > > development environment for James to add this annotation in my class and > a > > question popped up in my mind. > > Just adding annotation will take care of both Encryption/Decryption. I > > don't > > have to do anything else :-) > > Can't believe, Thanks so much for suggesting this solution. > > > > I have a class with filed declared 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 */ > > @Externalizer > > @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... > > } > > ******** > > Is this the correct way of doing it. Sorry for asking the same question > > again. I am very new to OpenJPA and this has become real critical for us. > > > > Thank you very much in advance. > > > > Thanks, Sai. > > > > > -- *Rick Curtis*
