Error Creating Objects with meaningful PKs

From: Axel HONFI (Axel.Honf..nvienna.org)
Date: Wed Oct 29 2003 - 08:17:03 EST

  • Next message: Andrus Adamchik: "Re: Error Creating Objects with meaningful PKs"

    Hello!

    I have a table called webpage with a composite primary key consisting of
    two FKs and one String field.
    These properties are recognized as primary keys, therefore there is no
    object-attribute mapped to them.
    Also the generated WebPage-object only has a default constructor.

    So I try to create a new object like:

    WebPage page = (WebPage)ctxt.createAndRegisterNewObject("WebPage");
    page.setToWebContext(webcontext_object);
    page.setToWebLanguage(weblanguage_object);
    page.writePropertyDirectly("uri",uri);
    ctxt.commitChanges(org.apache.log4j.Level.INFO);

    First cayenne queries for all rows in this table, and afterwards throws the
    following exception:

    org.objectstyle.cayenne.CayenneRuntimeException: [v.1.0.2 October 27 2003]
    org.objectstyle.cayenne.CayenneException: [v.1.0.2 October 27 2003] Error
    generating PK: Stored procedure 'auto_pk_for_table' not found. Specify
    owner.objectname or use sp_help to check whether the object exists (sp_help
    mayproduce lots of output).

    How can I create objects with meaningful primary keys?

    Thanks for any help,

    Axel



    This archive was generated by hypermail 2.0.0 : Wed Oct 29 2003 - 08:17:09 EST