Also it depends on which type of field you declare. Here's what I do in
Orion:

EJB 1.1:

public java.io.Serializable blob;

public setBlob(String blob) {
        this.blob = (java.io.Serializable) blob;
}

public String getBlob() {
        return (String) blob;
}

EJB 2.0

public void setBlobField(java.io.Serializable blob); //don't define in
either Remote nor Local
public java.io.Serializable getBlobField(); //don't define in either
Remote nor Local

public void setBlob(String blob) { //declare in Remote AND/OR Local
        setBlobField( (java.io.Serializable) String );
}

public String getBlob() { //declare in Remote AND/OR Local
        return (String) getBlobField();
}

>From my own experience, aggregating String is a VERY BAD IDEA. If your
contract is String, keep it that way. Maintaining the aggregated class
and the code that uses it will be a major mess, even if you have nice
tools like IDEA.

Juan Pablo Lorandi
Chief Software Architect
Code Foundry Ltd.
[EMAIL PROTECTED]

Barberstown, Straffan, Co. Kildare, Ireland.
Tel: +353-1-6012050  Fax: +353-1-6012051
Mobile: +353-86-2157900
www.codefoundry.com


> -----Original Message-----
> From: A mailing list for Enterprise JavaBeans development
> [mailto:[EMAIL PROTECTED]] On Behalf Of Mike Shoemaker
> Sent: Friday, September 13, 2002 1:16 PM
> To: [EMAIL PROTECTED]
> Subject: Re: CMP and BLOB datatype?
>
>
> Good point :)
>
> I could use aggregation instead by creating a class with a
> String as an attribute.  Im surprised that more people
> haven't responded to this.  I figured this is probably a
> fairly common problem.  Thanks for your input Dave!
>
> Mike
>
>
> At 07:24 AM 09/13/2002 -0400, Dave Glasser wrote:
> >On Thu, 12 Sep 2002 09:26:12 -0500, Mike Shoemaker
> ><[EMAIL PROTECTED]> wrote:
> >
> > >Hello folks
> > >
> > >I have a situation where I want to force a CMP Entity bean
> field to
> > >persist itself as a Blob datatype.  I have the database
> mapping setup
> > >to persist Strings as varchar2 as I don't want every string to be
> > >stored as a blob.  I was wondering what some reasonable solutions
> > >are.  Im thinking I could probably subclass string to create
> > >BlobString or some object like that.
> >
> >String is a final class. You can't subclass it.
> >
> >
> >To unsubscribe, send email to [EMAIL PROTECTED] and
> include in the
> >body of the message "signoff EJB-INTEREST".  For general help, send
> >email to [EMAIL PROTECTED] and include in the body of
> the message
> >"help".
>
> Mike Shoemaker
> http://www.shoesobjects.com
>
> ==============================================================
> =============
> To unsubscribe, send email to [EMAIL PROTECTED] and
> include in the body of the message "signoff EJB-INTEREST".
> For general help, send email to [EMAIL PROTECTED] and
> include in the body of the message "help".
>

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to