This question is locked. New answers and comments are not allowed.
[Persistent]
public class Categories
{
IList<Products> products;
public IList Products
{
get { return products; }
}
.
.
.
}
If the products has 1000 items, then when I want to remove all Category.products, then OpenAccess will send 1000+ sql query to delete all product.
Maybe you should consider simple sql like DELETE FROM Product p WHERE p.category_id=? when user call category.Products.Remove(), because we want to delete all collections.
public class Categories
{
IList<Products> products;
public IList Products
{
get { return products; }
}
.
.
.
}
If the products has 1000 items, then when I want to remove all Category.products, then OpenAccess will send 1000+ sql query to delete all product.
Maybe you should consider simple sql like DELETE FROM Product p WHERE p.category_id=? when user call category.Products.Remove(), because we want to delete all collections.