Here's what I mean:

--- "Juan Lorandi (Chile)" <[EMAIL PROTECTED]>
wrote:
> so did I... if you model CustomerInfo as an EJB and
> add a field to it...
> won't the DB table that holds this entity have to
> change to?

The problem (at least the one that I was refering to)
was NOT that CustomerInfo, either the java object or
the db table, might change.  Rather, what if
ContactInfo changes?  Suppose you save a CustomerInfo
record, with contact info serialized using this Java
object from the original example:
>>public class ContactInfo extends Object {
>>         public String UID;
>>         public String Type;
>>         public String Detail;
>> }

Then you add a new field (attribute, variable, etc) to
the Java object, say :
>>public class ContactInfo extends Object {
>>         public String UID;
>>         public String Type;
>>         public String Detail;
new:       public Date LastUpdate;
>> }

You will not be able to deserialize the contents of
the ContactInfo db field with this new object.


> JP
>

Lauren

> > -----Original Message-----
> > From: Lauren Commons [mailto:[EMAIL PROTECTED]]
> > Sent: Jueves, 01 de Febrero de 2001 18:45
> > To: [EMAIL PROTECTED]
> > Subject: Re: bean design problem for one to many
> relationship
> >
> >
> > I believe the problem he was refering to was that
> your
> > Java object might change, not the database table.
> If
> > you change the structure of your Java object, say
> be
> > adding a field, or changin a method signature, you
> > won't be able to deserialize the blob retrieved
> from
> > the database.
> >
> >
> > --- "Juan Lorandi (Chile)" <[EMAIL PROTECTED]>
> > wrote:
> > > I believe that for the problem presented, the
> > > serializable solution is the
> > > best balanced;
> > > ALL approachs have pro's and con's; I just felt
> this
> > > is the most
> > > satisfactory one.
> > >
> > > If ContactInfo will be accessed only thru
> Person,
> > > then it won't be needed to
> > > be in a SQL compatible way
> > > also, many DB's do not support an alter table
> > > command; so usually adding a
> > > field to a bean results in (a priori) total
> > > information loss. Of course,
> > > 'old' data could be migrated, but so could be
> > > serialized data.
> > >
> > > I don't believe in Entity for everything; in
> many
> > > cases it's the best way to
> > > go, but I felt that in this one is just like to
> kill
> > > a chicken with an
> > > A-Bomb.
> > >
> > > JP
> > >
> > > > -----Original Message-----
> > > > From: Thibault Cuvillier
> > > [mailto:[EMAIL PROTECTED]]
> > > > Sent: Jueves, 01 de Febrero de 2001 17:44
> > > > To: [EMAIL PROTECTED]
> > > > Subject: Re: bean design problem for one to
> many
> > > relationship
> > > >
> > > >
> > > > Using serialization to store data in an RDBMS
> is
> > > an horrible and
> > > > hugly solution ! ;)o
> > > > If the structure of your serialized object
> > > changed, you will
> > > > not be able
> > > > to reload the serialized object from the DB.
> > > >
> > > > Serialization should be never used for
> long-term
> > > storage.
> > > >
> > > > There is some limitation using BLOB on some
> > > application
> > > > servers (such as
> > > > with WLS)
> > > >
> > > > Tibo.
> > > > >-----Original Message-----
> > > > >From: Juan Lorandi (Chile)
> > > [mailto:[EMAIL PROTECTED]]
> > > > >Sent: Thursday, February 01, 2001 2:00 PM
> > > > >To: [EMAIL PROTECTED]
> > > > >Subject: Re: bean design problem for one to
> many
> > > relationship
> > > > >
> > > > >
> > > > >yes, you can use object's in CMP...
> > > > >I do that all the time with Orion Server
> > > > >just define the field as java.lang.Object,
> and
> > > the container's
> > > > >persistance
> > > > >manager
> > > > >will serialize the object and store it in a
> BLOB
> > > field in the
> > > > >database (for
> > > > >Oracle, for Sybase & SQL Server it will be
> image
> > > or varbinary).
> > > > >
> > > > >HTH
> > > > >
> > > > >JP
> > > > >
> > > > >PS: Of course, if you try to access the DB
> > > directly thru SQL,
> > > > >you will have
> > > > >to deserialize
> > > > >the Object manually. This will present
> additional
> > > difficulties
> > > > >if you aren't
> > > > >using Java.
> > > > >
> > > > >> -----Original Message-----
> > > > >> From: Jianguo Wang
> > > [mailto:[EMAIL PROTECTED]]
> > > > >> Sent: Jueves, 01 de Febrero de 2001 16:47
> > > > >> To: [EMAIL PROTECTED]
> > > > >> Subject: Re: bean design problem for one to
> > > many relationship
> > > > >>
> > > > >>
> > > > >> Hi,
> > > > >>
> > > > >> When you say that I can put ContactInfo in
> a
> > > Person
> > > > member, you mean
> > > > >> to use BMP, don't you? To my understanding,
> it
> > > is impossible
> > > > >> to use object
> > > > >> as a member in CMP because it can not match
> a
> > > object with a
> > > > >> field in the table.
> > > > >>
> > > > >> Please verify it for me.
> > > > >>
> > > > >> -John
> > > > >>
> > > > >> -----Original Message-----
> > > > >> From:   Juan Lorandi (Chile)
> > > [SMTP:[EMAIL PROTECTED]]
> > > > >> Sent:   Thursday, February 01, 2001 12:56
> PM
> > > > >> To:     [EMAIL PROTECTED]
> > > > >> Subject:        Re: bean design problem for
> one
> > > to many
> > > > relationship
> > > > >>
> > > > >> With this design, you could easily have 2
> CMP
> > > beans that do
> > > > >> just what you
> > > > >> want.
> > > > >> Alternatively, if contact info will only be
> > > accesible thru
> > > > >> Person, you could
> > > > >> store all ContactInfo
> > > > >> in a Person member:
> > > > >>
> > > > >> (very PSEUDO pseudo-code)
> > > > >> public class ContactInfo extends Object {
> > > > >>         public String UID;
> > > > >>         public String Type;
> > > > >>         public String Detail;
> > > > >> }
> > > > >>
> > > > >> and in Person:
> > > > >>
> > > > >> ..
> > > > >> public Vector contactInfoCollection;
> > > > >> ..
> > > > >>
> > > > >> public addContact(ContactInfo contact);
> > > > >> {
> > > > >>
> contactInfoCollection.add(ContactInfo);
> > > > >> }
> > > > >>
> > > > >>
> > > > >> HTH
> > > > >>
> > > > >> JP
> > > > >> > -----Original Message-----
> > > > >> > From: Jianguo Wang
>
=== message truncated ===


__________________________________________________
Get personalized email addresses from Yahoo! Mail - only $35
a year!  http://personal.mail.yahoo.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".

Reply via email to