RE: Getting relation with itself(same Object)

From: Dhruti Ramani (dhrutiraman..ahoo.com)
Date: Mon Jun 20 2005 - 16:00:20 EDT

  • Next message: Mike Kienenberger: "Re: Getting relation with itself(same Object)"

    It returns the same table as yours.

    "Gentry, Michael (Contractor)" <michael_gentr..anniemae.com> wrote:Cayenne should work just fine with PostgreSQL.
     
    The thing that confuses me is the error you list: pg_atoi, which sounds to me like "alpha to integer", so it seems to me somehow your table got created with that column (TABLE_NAME) set to be an integer. Do this in psql and see if yours differs:
     
    mrg=> \d AUTO_PK_SUPPORT
         Table "public.auto_pk_support"
       Column | Type | Modifiers
    ------------+----------------+-----------
     table_name | character(100) | not null
     next_id | integer | not null
     
    /dev/mrg
     

    -----Original Message-----
    From: Dhruti Ramani [mailto:dhrutiraman..ahoo.com]
    Sent: Monday, June 20, 2005 2:24 PM
    To: cayenne-use..bjectstyle.org
    Subject: RE: Getting relation with itself(same Object)

    "Gentry, Michael (Contractor)" <michael_gentr..anniemae.com> wrote: Hmmm ...
     
    If you click on the "Tables" tab in the modeler, is your "Deal" table selected (checked)? If not, click the checkbox and go back to the SQL Options tab. It should be in there now (assuming "Create Primary Key Support" is checked).
    >>> ya both where checked.
     
    If that isn't it, you can always bootstrap it by hand using SQL:
     
    INSERT INTO AUTO_PK_SUPPORT (TABLE_NAME, NEXT_ID) VALUES ('Deal', 200)
    >>> I have tried this it gives me this error:
    pg_atoi: error in "Deal": can't parse "Deal"
     
     
    (Note that the 200 is the first primary key to produce)
     
    You didn't mention, but I hope you are using Cayenne 1.1 currently. 1.2 is still in development and I know there are modeler changes, but I haven't looked into the differences yet.
     
    >>> Ya I am using cayenne 1.1 and postgresql as databse.
     
    Thanks,
    Denna
     

    -----Original Message-----
    From: Dhruti Ramani [mailto:dhrutiraman..ahoo.com]
    Sent: Monday, June 20, 2005 2:05 PM
    To: cayenne-use..bjectstyle.org
    Subject: RE: Getting relation with itself(same Object)

    hey thanks, you won't believe it but after I posted this question I did exactly what you sent here.
     
    But now I have another problem. My "Deal" object should have 1 to 1 relation with this "TypeToken" and if I do that in cayenne modeler and generate the database schema it does not create entry for "Deal" class in auto_pk_support.
     
    I also tried generating only "primary key support" for Deal but did not work.
     
    Any help?
    Thanks in advance,
    Denne

    "Michael Gentry (Yes, I'm a Contractor)" <michael_gentr..anniemae.com> wrote:
    This seems to come up a lot. Might should add a wiki page for it, but until
    then, try something like these screen shots.

    /dev/mrg

    ---------------------------------
    Yahoo! Sports
    Rekindle the Rivalries. Sign up for Fantasy Football

    ---------------------------------
    Yahoo! Sports
    Rekindle the Rivalries. Sign up for Fantasy Football

                    
    ---------------------------------
    Yahoo! Sports
     Rekindle the Rivalries. Sign up for Fantasy Football



    This archive was generated by hypermail 2.0.0 : Mon Jun 20 2005 - 16:00:24 EDT