Re: executing raw sql

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Thu Apr 17 2003 - 13:03:05 EDT

  • Next message: Michael Schuldt: "DataContext problem?"

    Martin,

    you can use SqlModifyQuery:

      String insertSQL = "INSERT INTO...";
      SqlModifyQuery insert = new SqlModifyQuery("CmUserGroup", insertSQL);

    BTW, if your performance problems are related to the big number of
    inserted objects being inserted, upgrading Cayenne to the latest nightly
    build (that will become Beta 1 in a few days) may help *a lot*.

    Andrus

    > Hi,
    > We're using cayenne
    > we have a memory and performance problem for a certain special cas
    > therefore
    > I like to execute a sql command i.e. INSERT INTO cm_user_group
    > (user_group_id, group_id, user_id) VALUES (1, 3, 100) instead of
    > CmUserGroup newusergroupentry =
    > (CmUserGroup)ctxt.createAndRegisterNewObject("CmUserGroup");
    > newusergroupentry.setToGroup(cmgroup);
    > newusergroupentry.setToUser(cmuser);
    >
    > how can I do that with cayenne, using the datacontext?
    > thanks for help
    > martin



    This archive was generated by hypermail 2.0.0 : Thu Apr 17 2003 - 13:03:06 EDT