Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Doesn't this break the object-relation mapping the ORM would be trying to do? Since the views would be producing resultsets that do not map to one single object? Or do you just define a new object type with virtual relations?


Exactly. I define a pair of DTOs for each virtual table: an input type (the shape of a record that can be inserted) and an output one (the shape of each record returned when you select from the virtual table, which might include generated, computed, and foreign columns, etc).

These types do not necessarily have to map to the underlying table types.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: