I've several cases where a single entity has multiple tables in the underlying database.
When reading or writing I want to handle all of the DB queries with a single class for that object, e.g., the SalesOrder
class has a corresponding SalesOrderQuery
class and that class uses the underlying tables of Sales_Order_Header
and Sales_Line
.
Is there a design pattern name for this approach (the class doing the persistance, not the classes making of the entities being persisted)?