ORM implementation in Erlang