I'm using Torque 3.2 and MySQL. I'm having no problems inserting data and selecting data, but when I try the following, it doesn't get saved to the database:

    if (OrderLine.lineExists(orderId, itemId)) {
      ol = OrderLine.getOrderLineById(orderId, itemId);
      ol.setQuantity(quantity);
      try {
        ol.save();
      } catch (Exception ex) {
      }
   }

I can throw a "System.out.println(ol.getQuantity())" after the setQuantity and it returns the updated quantity. The save just doesn't seem to stick.


Here's my getOrderLineById:

  public static OrderLine getOrderLineById(int orderId, int itemId) {
    try {
      Criteria c = new Criteria();
      c.add(OrderLinePeer.ORDER_ID, orderId);
      c.add(OrderLinePeer.ITEM_ID, itemId);
      List olList = OrderLinePeer.doSelect(c);
      return (OrderLine) olList.get(0);
    } catch (TorqueException ex) {
        // Log error to log file
    }
    return null;
  }

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to