Adam Esterline wrote:
> I think in Java it is impossible to have an uninitialized field.   Every
> field has a default value.   In your case I think that the char will be
> initialized to 0.   Have you tried printing out the opencode, before you
> initialize it?

true. my wording was poor. Im sure the field is getting initialized. What
Im trying to say is that there should be no value of a char field that
causes Castor to throw the exception of the type Im seeing:

Nested error: java.sql.SQLException: ERROR: Unterminated quoted string

If castor is going to save a java char variable to an sql table, any char
value should be a valid value. This looks like a bug to me.

Im trying to look into the source code but Im having weird shell script
problems running the build.sh script. For instance, any blank lines in the
script cause bash to give a ': command not found' error.

Don

>
> Adam
> ----- Original Message -----
> From: "Don Park" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Friday, August 31, 2001 1:10 AM
> Subject: [castor-dev] possible persistence bug in uninitialized char
> fields
>
>
> > I have a java class called Auction with a field of type char.
> >
> > the mapping entry for the field looks like:
> >     <field name="opencode" type="char">
> >      <sql name="opencode" type="char" />
> >     </field>
> >
> > If I do this:
> > auction = new com.removed.Auction();
> > try {
> >             db.begin();
> >             db.create(object);
> >             return true;
> > }  catch (PersistenceException pe) {
> > finally { db.commit(); }
> >
> > Nested error: java.sql.SQLException: ERROR: Unterminated quoted string
> >
> >
> > If instead I give opencode a value, it works fine.
> > auction = new com.removed.Auction();
> > auction.setOpencode('c');
> > try {
> >             db.begin();
> >             db.create(object);
> >             return true;
> > }  catch (PersistenceException pe) {}
> > finally { db.commit(); }
> >
> > Is this a bug?
>
>

-- 
** Home web site: http://klickitat.yi.org
** BeeHive Games, Multiplayer Bluetooth PDA Gaming  http://beehivegames.com
** irc: irc.openprojects.net nick: don-o channels: #palmchat,#java

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to