fetchAllEntities() only returns saved eo?
fetchAllEntities() only returns saved eo?
- Subject: fetchAllEntities() only returns saved eo?
- From: Yung-Luen Lan <email@hidden>
- Date: Sun, 2 Aug 2009 18:12:14 +0800
Hi,
I'm implementing a back-end of a e-commerce system, which do CRUD on product records.
To return a list of products, I wrote:
return Product.fetchAllProducts(ec);
To add a new product, I wrote:
Product p = new Product(); ec.insertObject(p); // the same ec as in Product.fetchAllProducts(ec)
p.setTitle("New Item"); return null;
Since I don't want the newly created product object be exposed to customer––especially when the price value is default value zero, I don't save the ec immediately. Instead, I have a save and cancel button to commit the product information.
However, when I add a new product, it's not shown in
Product.fetchAllProducts(ec). How can I get all the product objects in an ec nevertheless it has been saved or not? Thanks.
Regards,
yllan
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden