DORM, The Delphi ORM is a new ORM OpenSource framework for Delphi usable from DelphiXE+ (it should work also on D2010, but it is not tested on that version). It supports (and use) all the new RTTI features. Allows file, attributes and Convention Over Configuration mapping. There are big production systems based on it. It will be integrated in Delphi Spring Framework since the next major release.
It is developed by a small international community (6 people).
http://code.google.com/p/delphi-orm/
To show some basic features, this is a unittest actually used.
procedure TTestDORM.TestCRUD;
var
p1: TPerson;
p1asstring: string;
id: integer;
begin
p1 := TPerson.NewPerson;
try
Session.Save(p1);
p1asstring := p1.ToString;
id := p1.id;
Session.Commit;
finally
p1.Free;
end;
Session.StartTransaction;
p1 := Session.Load<TPerson>(id);
try
CheckEquals(p1asstring, p1.ToString);
Session.Commit;
finally
p1.Free;
end;
Session.StartTransaction;
p1 := Session.Load<TPerson>(id);
try
p1.FirstName := 'Scott';
p1.LastName := 'Summer';
p1.Age := 45;
p1.BornDate := EncodeDate(1965, 1, 1);
Session.Update(p1);
p1asstring := p1.ToString;
Session.Commit;
finally
p1.Free;
end;
Session.StartTransaction;
p1 := Session.Load<TPerson>(id);
try
CheckEquals(p1asstring, p1.ToString);
Session.Delete(p1);
Session.Commit;
finally
p1.Free;
end;
Session.StartTransaction;
p1 := Session.Load<TPerson>(id);
try
CheckNull(p1);
Session.Commit;
finally
p1.Free;
end;
end;
P.S. I'm the main and principal author of DORM