jargon

Design patterns·Objects and the database between them

the domain object has no idea a database exists, and a separate class knows which column each field came from.

Data mapper

Also calleddata mapper pattern, mapper layer

A layer that moves data between objects and the database while keeping them independent of each other and of itself. It is what makes a domain model testable without a database and free to differ from the schema — a class per table is not required, and neither is a table per class. The price is a mapping layer to maintain and a much larger gap between what you wrote and what the database sees.

Commonly confused with