Mark

I'm having troubles selecting an object after I insert it.  The
productAddList in the below code is an empty list after executing the code.
The doInsert method executes ok, and I can see the record is inserted, but
the select doesn't seem to be returning it.

try {
ObjectKey objectKey = ProductIdPeer.doInsert( criteria );

I think the criteria object may lose its properties after the above call, which is why the doSelect below fails.



productAddList = ProductIdPeer.doSelect( criteria );


        } catch ( Exception e)
        {
                context.put("exceptionMessage", e.getMessage());
        }

Try


ObjectKey objectKey = // set it to the correct value per your code
ProductIdPeer.doInsert( criteria );
productId = ProduuctIdPeer.retrieveByPK(objectKey);

Or, would it be easier to use a ProductId object, set its properties, save the object, and then just work with that object instead of selecting it from the database?

ProductId productId = new ProductId();
data.getParameters().setProperties(productId);
productId.save();
// now just use productId rather than getting it from the database

Eric


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



Reply via email to