What is a Object Relational Mapper?
A simple answer is that you wrap your tables or stored procedures in classes in your programming language, so that instead of writing SQL statements to interact with your database, you use methods and properties of objects.
In other words, instead of something like this:
String sql = "SELECT ... FROM persons WHERE id = 10" DbCommand cmd = new DbCommand(connection, sql); Result res = cmd.Execute(); String name = res[0]["FIRST_NAME"];you do something like this:
Person p = Person.Get(10);
or similar code (lots of variations here). The framework is what makes this code possible.
Now, benefits:
Casiano Rodriguez León 2015-01-07