You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by Patrick Tonidandel <pa...@wuerth.it> on 2001/09/05 12:08:53 UTC

Primary key cannot be smallint

Hi there,

i have got to work with an existing Sybase DB which has tables witch
smallint-columns as primary keys.

When I try to access the values of this primarykeys i get null.

During debugging i noticed that in the method populateObject of
BaseTABLENAMEPeer the method
row.getValue(offset+0).asBigDecimal()) returns NULL. This because this row
of table (Districtid)is smallint.
But Districtid is the primary key of this table and thats why it has to be
converted in bigdecimal, that fails.

Here is the method of the generated class BaseTABLENAMEPeer :

public static void populateObject (Record row,
                                   int offset,
                                   Areasellerrel obj )
 	throws Exception
{
	obj.setDistrictid(
	      new NumberKey(row.getValue(offset+0).asBigDecimal()));
      obj.setDescription(row.getValue(offset+1).asString());
}

How can I fix this problem.

Any help is very appreciated.

Regards
Patrick


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org


Re: Primary key cannot be smallint

Posted by John McNally <jm...@collab.net>.
This requires a fix to Vilage.  I am working on it.

john mcnally


Patrick Tonidandel wrote:
> 
> Hi there,
> 
> i have got to work with an existing Sybase DB which has tables witch
> smallint-columns as primary keys.
> 
> When I try to access the values of this primarykeys i get null.
> 
> During debugging i noticed that in the method populateObject of
> BaseTABLENAMEPeer the method
> row.getValue(offset+0).asBigDecimal()) returns NULL. This because this row
> of table (Districtid)is smallint.
> But Districtid is the primary key of this table and thats why it has to be
> converted in bigdecimal, that fails.
> 
> Here is the method of the generated class BaseTABLENAMEPeer :
> 
> public static void populateObject (Record row,
>                                    int offset,
>                                    Areasellerrel obj )
>         throws Exception
> {
>         obj.setDistrictid(
>               new NumberKey(row.getValue(offset+0).asBigDecimal()));
>       obj.setDescription(row.getValue(offset+1).asString());
> }
> 
> How can I fix this problem.
> 
> Any help is very appreciated.
> 
> Regards
> Patrick
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-dev-help@jakarta.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org