This question is locked. New answers and comments are not allowed.
Hi,
I have the following problem:
In the data model, there are three classes 'order ','orderitems' and 'product '. Each order has an unlimited number of order positions. Each position item has exactly one entry for a product.
The order positions for a order will have row number (orderposition). When creating the classes, the mapper, however, produced four tables: ordr, ordr_order_item, order_item and product.
My problem is that when you delete a order position in the connection table between order and order the item correctly processed. The table with the order position itself, however, is not changed and therefore contains records that are no longer connected to a record in the order table.
My question is: How can I make the mapper just the three required to create tables.
For suggestions, I would be grateful.
Christian
In the data model, there are three classes 'order ','orderitems' and 'product '. Each order has an unlimited number of order positions. Each position item has exactly one entry for a product.
using System; |
using System.Collections.Generic; |
using System.Linq; |
using System.Text; |
namespace OrderTest |
{ |
[Telerik.OpenAccess.Persistent()] |
public class Order |
{ |
public Order(){} |
private string ordername; |
private IList<OrderItem> orderitems; |
public string Ordername |
{ |
get |
{ |
return this.ordername; |
} |
set |
{ |
this.ordername = value; |
} |
} |
} |
[Telerik.OpenAccess.Persistent()] |
public class Product |
{ |
public Product() |
{ |
} |
private string productname; |
[Telerik.OpenAccess.FieldAlias("productname")] |
public string Productname |
{ |
get |
{ |
return this.productname; |
} |
set |
{ |
this.productname = value; |
} |
} |
} |
[Telerik.OpenAccess.Persistent()] |
public class OrderItem |
{ |
private Product ordercontent; |
private int orderposition; |
public OrderItem(){} |
public Product OrderContent |
{ |
get |
{ |
return this.ordercontent; |
} |
set |
{ |
this.ordercontent = value; |
} |
} |
public int OrderPosition |
{ |
get |
{ |
return this.orderposition; |
} |
set |
{ |
this.orderposition = value; |
} |
} |
} |
} |
The order positions for a order will have row number (orderposition). When creating the classes, the mapper, however, produced four tables: ordr, ordr_order_item, order_item and product.
My problem is that when you delete a order position in the connection table between order and order the item correctly processed. The table with the order position itself, however, is not changed and therefore contains records that are no longer connected to a record in the order table.
My question is: How can I make the mapper just the three required to create tables.
For suggestions, I would be grateful.
Christian