Are you looking for an ORM? It seems so. - I am used to the technology “object-relational mapping” to some degree.