You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Edson Carlos Ericksson Richter <ed...@mgrinformatica.com.br> on 2003/09/05 02:05:37 UTC

upgrade from rc3 to CVS Head rc4 doesn't work

I've just updated from rc3 to CVS Head rc4 and now I'm facing problems.

First one is a Null Pointer Exception in 

org.apache.ojb.broker.accesslayer.sql.SqlQueryStatement.getColName(SqlQueryStatement.java:278)
org.apache.ojb.broker.accesslayer.sql.SqlQueryStatement.appendColName(SqlQueryStatement.java:331)org.apache.ojb.broker.accesslayer.sql.SqlQueryStatement.appendSelectionCriteria(SqlQueryStatement.java:721)
org.apache.ojb.broker.accesslayer.sql.SqlQueryStatement.appendCriteria(SqlQueryStatement.java:762)
org.apache.ojb.broker.accesslayer.sql.SqlQueryStatement.appendSQLClause(SqlQueryStatement.java:800)org.apache.ojb.broker.accesslayer.sql.SqlQueryStatement.asSQLStatement(SqlQueryStatement.java:586)
org.apache.ojb.broker.accesslayer.sql.SqlQueryStatement.appendClause(SqlQueryStatement.java:522)
org.apache.ojb.broker.accesslayer.sql.SqlQueryStatement.appendWhereClause(SqlQueryStatement.java:480)

and so on...

Some tip?

Thanks,

Edson Richter



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.515 / Virus Database: 313 - Release Date: 1/9/2003

Re: upgrade from rc3 to CVS Head rc4 doesn't work

Posted by Armin Waibel <ar...@code-au-lait.de>.
Thanks Kurt! It's checked in.
Think we need more test cases ;-)

regards,
Armin

----- Original Message -----
From: "Kurt R. Hoehn" <kh...@etechstudios.com>
To: <oj...@db.apache.org>
Sent: Friday, September 05, 2003 8:40 PM
Subject: Re: upgrade from rc3 to CVS Head rc4 doesn't work


> In that same method you may also want to do the following
>
> you should check to see if aTableAlias has joins before trying to get
the
> iterator.
>
>
f(!fld.getClassDescriptor().getFullTableName().equals( aTableAlias.table
)
>         && aTableAlias.hasJoins() )
> {
>     Iterator itr = aTableAlias.joins.iterator();
>     while( itr.hasNext() )
>     {
>         Join join = (Join) itr.next();
>
>         // This needs to be changed also to
>         //
join.right.table.equals(fld.getClassDescriptor().getFullTableName())
>
>         if( join.right.table ==
fld.getClassDescriptor().getFullTableName() )
>         {
>             result = join.right.alias + "." + fld.getColumnName();
>             break;
>         }
>     }
>
>     if( result == null )
>     {
>         result = aPathInfo.column;
>     }
> }
>
> -kurt
>
>
> On Fri, 05 Sep 2003 18:59:14 +0200, Armin Waibel wrote:
>
> > Hi Edson,
> >
> > think you are right, the first statement doesn't
> > make sense.
> > I checked in your changes. Thanks!!
> >
> > regards,
> > Armin
> >
> > ----- Original Message -----
> > From: "Edson Carlos Ericksson Richter"
> > <ed...@mgrinformatica.com.br>
> > To: "OJB Users List" <oj...@db.apache.org>
> > Sent: Friday, September 05, 2003 4:30 PM
> > Subject: Re: upgrade from rc3 to CVS Head rc4 doesn't work
> >
> >
> > I've discovered the problem. The error is related to
> >
> >                 if( fld.getClassDescriptor().getFullTableName() !=
> > aTableAlias.table )
> >
> > It should not be
> >
> >                 if( !
> >
ld.getClassDescriptor().getFullTableName().equals( aTableAlias.table )
> > )
> >
> > ???
> >
> > Thanks,
> >
> > Edson Richter
> >
> >   ----- Original Message -----
> >   From: Edson Carlos Ericksson Richter
> >   To: OJB Users List
> >   Sent: Friday, September 05, 2003 10:59 AM
> >   Subject: Re: upgrade from rc3 to CVS Head rc4 doesn't work
> >
> >
> >   Ok, let's go. My app is working for month on top of rc3 (with some
bug
> > fixes - I am using a CVS Head until 1.0 final doesnt came to us, the
> > mortals).
> >
> >   Yesterday I've downloaded rc4 and noticed changes in
OJB.properties
> > and DTD.
> >   I've adjusted the new OJB.properties to my app (I'm using beans
with
> > formal getters/setters), and DBCP impl for connections.
> >
> >   But I've discovered a (bug?) problem in SqlSelecteStatement.
Debugging
> > I came to (SqlQueryStatement)
> >
> >    protected String getColName(TableAlias aTableAlias, PathInfo
> > aPathInfo, boolean translate)
> >   ...
> >      if (fld != null)
> >      {
> >                   // added to suport the super reference descriptor
> >                   if( fld.getClassDescriptor().getFullTableName() !=
> > aTableAlias.table )
> >                   {
> >                       Iterator itr = aTableAlias.joins.iterator();
> >                       while( itr.hasNext() )
> >                       {
> >                           Join join = (Join) itr.next();
> >                           if( join.right.table ==
> > fld.getClassDescriptor().getFullTableName() )
> >                           {
> >                               result = join.right.alias + "." +
> > fld.getColumnName();
> >                               break;
> >                           }
> >                       }
> >
> >                       if( result == null )
> >                       {
> >                           result = aPathInfo.column;
> >                       }
> >                   }
> >                   else
> >                   {
> >           result = aTableAlias.alias + "." + fld.getColumnName();
> >                   }
> >      }
> >
> >
> >   But what happens if aTableAlias has no joins? The line
> >
> >   Iterator itr = aTableAlias.joins.iterator();
> >
> >   Will thrown a NullPointerException (what I'm having).
> >   Could someone confirm this?
> >
> >
> >   Thanks,
> >
> >   Edson Richter
> >
> >
> >
> >
> >   ---
> >   Outgoing mail is certified Virus Free.
> >   Checked by AVG anti-virus system (http://www.grisoft.com).
> >   Version: 6.0.515 / Virus Database: 313 - Release Date: 1/9/2003
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
>
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Re: upgrade from rc3 to CVS Head rc4 doesn't work (solved)

Posted by Edson Carlos Ericksson Richter <ed...@mgrinformatica.com.br>.
Thanks to all. This is working fine by now.

Edson Richter
  ----- Original Message ----- 
  From: Kurt R. Hoehn 
  To: ojb-user@db.apache.org 
  Sent: Friday, September 05, 2003 3:40 PM
  Subject: Re: upgrade from rc3 to CVS Head rc4 doesn't work


  In that same method you may also want to do the following

  you should check to see if aTableAlias has joins before trying to get the
  iterator.

  if(!fld.getClassDescriptor().getFullTableName().equals( aTableAlias.table)
          && aTableAlias.hasJoins() )
  {
      Iterator itr = aTableAlias.joins.iterator();
      while( itr.hasNext() )
      {
          Join join = (Join) itr.next();
          
          // This needs to be changed also to
          // join.right.table.equals(fld.getClassDescriptor().getFullTableName())
         
          if( join.right.table == fld.getClassDescriptor().getFullTableName() )
          {
              result = join.right.alias + "." + fld.getColumnName();
              break;
          }
      }

      if( result == null )
      {
          result = aPathInfo.column;
      }
  }

  -kurt


  On Fri, 05 Sep 2003 18:59:14 +0200, Armin Waibel wrote:

  > Hi Edson,
  > 
  > think you are right, the first statement doesn't
  > make sense.
  > I checked in your changes. Thanks!!
  > 
  > regards,
  > Armin
  > 
  > ----- Original Message -----
  > From: "Edson Carlos Ericksson Richter"
  > <ed...@mgrinformatica.com.br>
  > To: "OJB Users List" <oj...@db.apache.org>
  > Sent: Friday, September 05, 2003 4:30 PM
  > Subject: Re: upgrade from rc3 to CVS Head rc4 doesn't work
  > 
  > 
  > I've discovered the problem. The error is related to
  > 
  >                 if( fld.getClassDescriptor().getFullTableName() !=
  > aTableAlias.table )
  > 
  > It should not be
  > 
  >                 if( !
  > fld.getClassDescriptor().getFullTableName().equals( aTableAlias.table ) 
  > )
  > 
  > ???
  > 
  > Thanks,
  > 
  > Edson Richter
  > 
  >   ----- Original Message -----
  >   From: Edson Carlos Ericksson Richter
  >   To: OJB Users List
  >   Sent: Friday, September 05, 2003 10:59 AM
  >   Subject: Re: upgrade from rc3 to CVS Head rc4 doesn't work
  > 
  > 
  >   Ok, let's go. My app is working for month on top of rc3 (with some bug
  > fixes - I am using a CVS Head until 1.0 final doesnt came to us, the
  > mortals).
  > 
  >   Yesterday I've downloaded rc4 and noticed changes in OJB.properties
  > and DTD.
  >   I've adjusted the new OJB.properties to my app (I'm using beans with
  > formal getters/setters), and DBCP impl for connections.
  > 
  >   But I've discovered a (bug?) problem in SqlSelecteStatement. Debugging
  > I came to (SqlQueryStatement)
  > 
  >    protected String getColName(TableAlias aTableAlias, PathInfo
  > aPathInfo, boolean translate)
  >   ...
  >      if (fld != null)
  >      {
  >                   // added to suport the super reference descriptor
  >                   if( fld.getClassDescriptor().getFullTableName() !=
  > aTableAlias.table )
  >                   {
  >                       Iterator itr = aTableAlias.joins.iterator();
  >                       while( itr.hasNext() )
  >                       {
  >                           Join join = (Join) itr.next();
  >                           if( join.right.table ==
  > fld.getClassDescriptor().getFullTableName() )
  >                           {
  >                               result = join.right.alias + "." +
  > fld.getColumnName();
  >                               break;
  >                           }
  >                       }
  > 
  >                       if( result == null )
  >                       {
  >                           result = aPathInfo.column;
  >                       }
  >                   }
  >                   else
  >                   {
  >           result = aTableAlias.alias + "." + fld.getColumnName();
  >                   }
  >      }
  > 
  > 
  >   But what happens if aTableAlias has no joins? The line
  > 
  >   Iterator itr = aTableAlias.joins.iterator();
  > 
  >   Will thrown a NullPointerException (what I'm having).
  >   Could someone confirm this?
  > 
  > 
  >   Thanks,
  > 
  >   Edson Richter
  > 
  > 
  > 
  > 
  >   ---
  >   Outgoing mail is certified Virus Free.
  >   Checked by AVG anti-virus system (http://www.grisoft.com).
  >   Version: 6.0.515 / Virus Database: 313 - Release Date: 1/9/2003



  ---------------------------------------------------------------------
  To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
  For additional commands, e-mail: ojb-user-help@db.apache.org



  ---
  Outgoing mail is certified Virus Free.
  Checked by AVG anti-virus system (http://www.grisoft.com).
  Version: 6.0.515 / Virus Database: 313 - Release Date: 1/9/2003

Re: upgrade from rc3 to CVS Head rc4 doesn't work

Posted by "Kurt R. Hoehn" <kh...@etechstudios.com>.
In that same method you may also want to do the following

you should check to see if aTableAlias has joins before trying to get the
iterator.

if(!fld.getClassDescriptor().getFullTableName().equals( aTableAlias.table)
        && aTableAlias.hasJoins() )
{
    Iterator itr = aTableAlias.joins.iterator();
    while( itr.hasNext() )
    {
        Join join = (Join) itr.next();
        
        // This needs to be changed also to
        // join.right.table.equals(fld.getClassDescriptor().getFullTableName())
       
        if( join.right.table == fld.getClassDescriptor().getFullTableName() )
        {
            result = join.right.alias + "." + fld.getColumnName();
            break;
        }
    }

    if( result == null )
    {
        result = aPathInfo.column;
    }
}

-kurt


On Fri, 05 Sep 2003 18:59:14 +0200, Armin Waibel wrote:

> Hi Edson,
> 
> think you are right, the first statement doesn't
> make sense.
> I checked in your changes. Thanks!!
> 
> regards,
> Armin
> 
> ----- Original Message -----
> From: "Edson Carlos Ericksson Richter"
> <ed...@mgrinformatica.com.br>
> To: "OJB Users List" <oj...@db.apache.org>
> Sent: Friday, September 05, 2003 4:30 PM
> Subject: Re: upgrade from rc3 to CVS Head rc4 doesn't work
> 
> 
> I've discovered the problem. The error is related to
> 
>                 if( fld.getClassDescriptor().getFullTableName() !=
> aTableAlias.table )
> 
> It should not be
> 
>                 if( !
> fld.getClassDescriptor().getFullTableName().equals( aTableAlias.table ) 
> )
> 
> ???
> 
> Thanks,
> 
> Edson Richter
> 
>   ----- Original Message -----
>   From: Edson Carlos Ericksson Richter
>   To: OJB Users List
>   Sent: Friday, September 05, 2003 10:59 AM
>   Subject: Re: upgrade from rc3 to CVS Head rc4 doesn't work
> 
> 
>   Ok, let's go. My app is working for month on top of rc3 (with some bug
> fixes - I am using a CVS Head until 1.0 final doesnt came to us, the
> mortals).
> 
>   Yesterday I've downloaded rc4 and noticed changes in OJB.properties
> and DTD.
>   I've adjusted the new OJB.properties to my app (I'm using beans with
> formal getters/setters), and DBCP impl for connections.
> 
>   But I've discovered a (bug?) problem in SqlSelecteStatement. Debugging
> I came to (SqlQueryStatement)
> 
>    protected String getColName(TableAlias aTableAlias, PathInfo
> aPathInfo, boolean translate)
>   ...
>      if (fld != null)
>      {
>                   // added to suport the super reference descriptor
>                   if( fld.getClassDescriptor().getFullTableName() !=
> aTableAlias.table )
>                   {
>                       Iterator itr = aTableAlias.joins.iterator();
>                       while( itr.hasNext() )
>                       {
>                           Join join = (Join) itr.next();
>                           if( join.right.table ==
> fld.getClassDescriptor().getFullTableName() )
>                           {
>                               result = join.right.alias + "." +
> fld.getColumnName();
>                               break;
>                           }
>                       }
> 
>                       if( result == null )
>                       {
>                           result = aPathInfo.column;
>                       }
>                   }
>                   else
>                   {
>           result = aTableAlias.alias + "." + fld.getColumnName();
>                   }
>      }
> 
> 
>   But what happens if aTableAlias has no joins? The line
> 
>   Iterator itr = aTableAlias.joins.iterator();
> 
>   Will thrown a NullPointerException (what I'm having).
>   Could someone confirm this?
> 
> 
>   Thanks,
> 
>   Edson Richter
> 
> 
> 
> 
>   ---
>   Outgoing mail is certified Virus Free.
>   Checked by AVG anti-virus system (http://www.grisoft.com).
>   Version: 6.0.515 / Virus Database: 313 - Release Date: 1/9/2003



---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Re: upgrade from rc3 to CVS Head rc4 doesn't work

Posted by Armin Waibel <ar...@code-au-lait.de>.
Hi Edson,

think you are right, the first statement doesn't
make sense.
I checked in your changes. Thanks!!

regards,
Armin

----- Original Message -----
From: "Edson Carlos Ericksson Richter"
<ed...@mgrinformatica.com.br>
To: "OJB Users List" <oj...@db.apache.org>
Sent: Friday, September 05, 2003 4:30 PM
Subject: Re: upgrade from rc3 to CVS Head rc4 doesn't work


I've discovered the problem. The error is related to

                if( fld.getClassDescriptor().getFullTableName() !=
aTableAlias.table )

It should not be

                if( !
fld.getClassDescriptor().getFullTableName().equals( aTableAlias.table ) 
)

???

Thanks,

Edson Richter

  ----- Original Message -----
  From: Edson Carlos Ericksson Richter
  To: OJB Users List
  Sent: Friday, September 05, 2003 10:59 AM
  Subject: Re: upgrade from rc3 to CVS Head rc4 doesn't work


  Ok, let's go. My app is working for month on top of rc3 (with some bug
fixes - I am using a CVS Head until 1.0 final doesnt came to us, the
mortals).

  Yesterday I've downloaded rc4 and noticed changes in OJB.properties
and DTD.
  I've adjusted the new OJB.properties to my app (I'm using beans with
formal getters/setters), and DBCP impl for connections.

  But I've discovered a (bug?) problem in SqlSelecteStatement. Debugging
I came to (SqlQueryStatement)

   protected String getColName(TableAlias aTableAlias, PathInfo
aPathInfo, boolean translate)
  ...
     if (fld != null)
     {
                  // added to suport the super reference descriptor
                  if( fld.getClassDescriptor().getFullTableName() !=
aTableAlias.table )
                  {
                      Iterator itr = aTableAlias.joins.iterator();
                      while( itr.hasNext() )
                      {
                          Join join = (Join) itr.next();
                          if( join.right.table ==
fld.getClassDescriptor().getFullTableName() )
                          {
                              result = join.right.alias + "." +
fld.getColumnName();
                              break;
                          }
                      }

                      if( result == null )
                      {
                          result = aPathInfo.column;
                      }
                  }
                  else
                  {
          result = aTableAlias.alias + "." + fld.getColumnName();
                  }
     }


  But what happens if aTableAlias has no joins? The line

  Iterator itr = aTableAlias.joins.iterator();

  Will thrown a NullPointerException (what I'm having).
  Could someone confirm this?


  Thanks,

  Edson Richter




  ---
  Outgoing mail is certified Virus Free.
  Checked by AVG anti-virus system (http://www.grisoft.com).
  Version: 6.0.515 / Virus Database: 313 - Release Date: 1/9/2003



---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Re: upgrade from rc3 to CVS Head rc4 doesn't work

Posted by Edson Carlos Ericksson Richter <ed...@mgrinformatica.com.br>.
I've discovered the problem. The error is related to

                if( fld.getClassDescriptor().getFullTableName() != aTableAlias.table )

It should not be

                if( ! fld.getClassDescriptor().getFullTableName().equals( aTableAlias.table ) )

???

Thanks,

Edson Richter

  ----- Original Message ----- 
  From: Edson Carlos Ericksson Richter 
  To: OJB Users List 
  Sent: Friday, September 05, 2003 10:59 AM
  Subject: Re: upgrade from rc3 to CVS Head rc4 doesn't work


  Ok, let's go. My app is working for month on top of rc3 (with some bug fixes - I am using a CVS Head until 1.0 final doesnt came to us, the mortals).

  Yesterday I've downloaded rc4 and noticed changes in OJB.properties and DTD.
  I've adjusted the new OJB.properties to my app (I'm using beans with formal getters/setters), and DBCP impl for connections.

  But I've discovered a (bug?) problem in SqlSelecteStatement. Debugging I came to (SqlQueryStatement)

   protected String getColName(TableAlias aTableAlias, PathInfo aPathInfo, boolean translate)
  ...
     if (fld != null)
     {
                  // added to suport the super reference descriptor
                  if( fld.getClassDescriptor().getFullTableName() != aTableAlias.table )
                  {
                      Iterator itr = aTableAlias.joins.iterator();
                      while( itr.hasNext() )
                      {
                          Join join = (Join) itr.next();
                          if( join.right.table == fld.getClassDescriptor().getFullTableName() )
                          {
                              result = join.right.alias + "." + fld.getColumnName();
                              break;
                          }
                      }

                      if( result == null )
                      {
                          result = aPathInfo.column;
                      }
                  }
                  else
                  {
          result = aTableAlias.alias + "." + fld.getColumnName();
                  }
     }


  But what happens if aTableAlias has no joins? The line

  Iterator itr = aTableAlias.joins.iterator();

  Will thrown a NullPointerException (what I'm having).
  Could someone confirm this?


  Thanks,

  Edson Richter




  ---
  Outgoing mail is certified Virus Free.
  Checked by AVG anti-virus system (http://www.grisoft.com).
  Version: 6.0.515 / Virus Database: 313 - Release Date: 1/9/2003

Re: upgrade from rc3 to CVS Head rc4 doesn't work

Posted by Edson Carlos Ericksson Richter <ed...@mgrinformatica.com.br>.
Ok, let's go. My app is working for month on top of rc3 (with some bug fixes - I am using a CVS Head until 1.0 final doesnt came to us, the mortals).

Yesterday I've downloaded rc4 and noticed changes in OJB.properties and DTD.
I've adjusted the new OJB.properties to my app (I'm using beans with formal getters/setters), and DBCP impl for connections.

But I've discovered a (bug?) problem in SqlSelecteStatement. Debugging I came to (SqlQueryStatement)

 protected String getColName(TableAlias aTableAlias, PathInfo aPathInfo, boolean translate)
...
   if (fld != null)
   {
                // added to suport the super reference descriptor
                if( fld.getClassDescriptor().getFullTableName() != aTableAlias.table )
                {
                    Iterator itr = aTableAlias.joins.iterator();
                    while( itr.hasNext() )
                    {
                        Join join = (Join) itr.next();
                        if( join.right.table == fld.getClassDescriptor().getFullTableName() )
                        {
                            result = join.right.alias + "." + fld.getColumnName();
                            break;
                        }
                    }

                    if( result == null )
                    {
                        result = aPathInfo.column;
                    }
                }
                else
                {
        result = aTableAlias.alias + "." + fld.getColumnName();
                }
   }


But what happens if aTableAlias has no joins? The line

Iterator itr = aTableAlias.joins.iterator();

Will thrown a NullPointerException (what I'm having).
Could someone confirm this?


Thanks,

Edson Richter




---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.515 / Virus Database: 313 - Release Date: 1/9/2003