This technique goes back to the late 90s where Apple WebObjects (owned by NeXT at the time) pioneered this approach in their web framework.
https://en.wikipedia.org/wiki/WebObjects
Was quite revolutionary at the time and it also included the first (or one of the very earliest at least) SQL ORMs.