Sorry Shiv,

I did not read the subject message i.e. "Oracle" and was thrown by the "I
would have had char(1)" which I believed to mean that the database was
already designed. In the case of Oracle you should be using the Number data
type in Oracle for the mapping of the boolean. If the database value for
this field could be null you should use the Boolean class else just the
primitive boolean is suffice. Anyway the code listed below can be used as
reference for other similar situations i.e. you have a reference object i.e.
country [code, desc] and you only want to store the code field in the
database - note need to take care of potential null not listed.

kind regards,

William Louth

> -----Original Message-----
> From: [EMAIL PROTECTED] [SMTP:[EMAIL PROTECTED]]
> Sent: Tuesday, May 02, 2000 2:50 PM
> To:   [EMAIL PROTECTED]
> Subject:      Re: Oracle - boolean - CMP
>
> When I added a boolean field in Core for IAS the mapping was number(1,0)
> as
> per the ias40ejb
>
> > -----Original Message-----
> > From: Louth, William (Exchange) [SMTP:[EMAIL PROTECTED]]
> > Sent: Tuesday, May 02, 2000 3:29 PM
> > To:   [EMAIL PROTECTED]
> > Subject:      Re: Oracle - boolean - CMP
> >
> > Hi Shiv,
> >
> > If your database, jdbc driver, or application server does not support
> the
> > conversion then the following is a solution:
> >
> > // bean fields
> > private boolean _married;
> > public char married; // cmp field
> >
> > in ejbLoad...
> >   _married = (married=='Y'); // the married cmp field will be set prior
> to
> > this call
> >
> > in ejbStore...
> >   married = (_married) ? 'Y' : 'N'; // synch the cmp field before
> > storing..
> > this is why WebLogic should call ejbStore and then try to detect change
> >
> > in ejbCreate...
> >   _married = married;
> >
> > // bean methods
> > boolean isMarried() { return _married; }
> > isMarried(boolean married) { _married = married; }
> >
> > Very quickly and untested but I think this should be a workaround. There
> > is
> > probably something more elegant in the jdbc driver or appserver manual.
> >
> > kind regards
> >
> > William Louth
> >
> > > -----Original Message-----
> > > From: Shiv Kumar [SMTP:[EMAIL PROTECTED]]
> > > Sent: Tuesday, May 02, 2000 12:27 PM
> > > To:   [EMAIL PROTECTED]
> > > Subject:      Oracle - boolean - CMP
> > >
> > > Hi all
> > >
> > > One of the columns in my table should be interpreted as boolean data
> > type.
> > >
> > >   1. How do I create the table (if not for EJB, I would have had
> char(1)
> > > with
> > >      'Y' and 'N' as valid values)?
> > >
> > >   2. What special settings should be done in the deployment descriptor
> > so
> > > that
> > >      my CMP entity bean can work this way:
> > >
> > >           home.create(int empID, String empName, boolean married);
> > >
> > > Thanks.
> > > --
> > > shiv
> > > [EMAIL PROTECTED]
> > >
> > >
> > >
> > > __________________________________________________
> > > Do You Yahoo!?
> > > Talk to your friends online with Yahoo! Messenger.
> > > http://im.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".
> >
> >
> > ***********************************************************************
> > Bear Stearns is not responsible for any recommendation, solicitation,
> > offer or agreement or any information about any transaction, customer
> > account or account activity contained in this communication.
> > ***********************************************************************
> >
> >
> ==========================================================================
> > =
> > 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".


***********************************************************************
Bear Stearns is not responsible for any recommendation, solicitation,
offer or agreement or any information about any transaction, customer
account or account activity contained in this communication.
***********************************************************************

===========================================================================
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