How to Insert an Object

In DObject O/R Mapping persistence layer, it's simple to insert an object: just create a new entity object and assign its properties, then Save it as the following sample:

var

  customer : ICustomer;

begin

  customer := TCustomer.Create(ObjectManager);

  customer.CustomerID := 'ATEST';

  customer.CompanyName := 'Macrobject Software';

  customer.Country := 'China';

  customer.City := 'Macrobject City';

  customer.Save;

end;

 

Related Topics

Using Persistence Layer