You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by fanyun <yu...@vtradex.com> on 2001/04/06 05:09:47 UTC

migration from 10 to 13

Hi:

I am now try to migrate my system from 10 to 13.

I find the most big problem is  torque primary key.  It changes from int to
NumberKey.  There are about 1K getId() in my system and another 500 setId().


Our solution now is change the template to generate a compatible getId() and
setId().

     public int getId()
     {
          return id.getBigDecimal().intValue();
     }

    public void setId(int v )
    {
         setId(new NumberKey(BigDecimal.valueOf((long)v)));
    }


My question is is there any better way to do the migration, I really do not
want to have a different template.



Regards

fanyun


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


Re: migration from 10 to 13

Posted by John McNally <jm...@collab.net>.
The BaseObject.getPrimaryKeyAsInt() and getPrimaryKeyAsLong() methods
should work.

john mcnally

fanyun wrote:
> 
> Hi:
> 
> I am now try to migrate my system from 10 to 13.
> 
> I find the most big problem is  torque primary key.  It changes from int to
> NumberKey.  There are about 1K getId() in my system and another 500 setId().
> 
> Our solution now is change the template to generate a compatible getId() and
> setId().
> 
>      public int getId()
>      {
>           return id.getBigDecimal().intValue();
>      }
> 
>     public void setId(int v )
>     {
>          setId(new NumberKey(BigDecimal.valueOf((long)v)));
>     }
> 
> My question is is there any better way to do the migration, I really do not
> want to have a different template.
> 
> Regards
> 
> fanyun
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org

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


RE: migration from 10 to 13

Posted by fanyun <yu...@vtradex.com>.
Thanks for your information.

I finally find a way.

Since all the primary key in my system named Id.   I do a replace all in
files with UltraEdit.   Replace getId()    with
getId().getBigDecimal().intValue().

This works. The 1K compile error solved.



Regards

fanyun




-----Original Message-----
From: Arkaitz [mailto:arkbit@yahoo.com]
Sent: Saturday, April 07, 2001 3:26 AM
To: turbine-user@jakarta.apache.org
Subject: Re: migration from 10 to 13


Hi,

I had the same problem with retrieveByPK(), and found a way around it.
You can add getId() and setId() to your OM classes, which in turn will
call to the Base classes's methods.
Something like this (untested):

    public setId(int id)
    {
        NumberKey key = new NumberKey (Integer.toString(id));
        this.setId (key);
    }
    And similarly with getId()

Hope this helps,

Cheers,
Arkaitz.




On 06 Apr 2001 11:09:47 +0800, fanyun wrote:
> Hi:
>
> I am now try to migrate my system from 10 to 13.
>
> I find the most big problem is  torque primary key.  It changes from int
to
> NumberKey.  There are about 1K getId() in my system and another 500
setId().
>
>
> Our solution now is change the template to generate a compatible getId()
and
> setId().
>
>      public int getId()
>      {
>           return id.getBigDecimal().intValue();
>      }
>
>     public void setId(int v )
>     {
>          setId(new NumberKey(BigDecimal.valueOf((long)v)));
>     }
>
>
> My question is is there any better way to do the migration, I really do
not
> want to have a different template.
>
>
>
> Regards
>
> fanyun
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org

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



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


Re: migration from 10 to 13

Posted by Arkaitz <ar...@yahoo.com>.
Hi,

I had the same problem with retrieveByPK(), and found a way around it.
You can add getId() and setId() to your OM classes, which in turn will
call to the Base classes's methods.
Something like this (untested):

    public setId(int id)
    {
        NumberKey key = new NumberKey (Integer.toString(id));
        this.setId (key);
    }
    And similarly with getId()

Hope this helps,

Cheers,
Arkaitz. 




On 06 Apr 2001 11:09:47 +0800, fanyun wrote:
> Hi:
> 
> I am now try to migrate my system from 10 to 13.
> 
> I find the most big problem is  torque primary key.  It changes from int to
> NumberKey.  There are about 1K getId() in my system and another 500 setId().
> 
> 
> Our solution now is change the template to generate a compatible getId() and
> setId().
> 
>      public int getId()
>      {
>           return id.getBigDecimal().intValue();
>      }
> 
>     public void setId(int v )
>     {
>          setId(new NumberKey(BigDecimal.valueOf((long)v)));
>     }
> 
> 
> My question is is there any better way to do the migration, I really do not
> want to have a different template.
> 
> 
> 
> Regards
> 
> fanyun
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org

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