If you're never really going to need the metadata in isolation, treat the Order as an aggregate, and just have a save_order method on your repo that accepts a (domain layer) Order instance (which itself has a Metadata instance), and then transform your data and store both. Same when loading, but in reverse (and you probably want to load a number of objects based on some query, not just one).
↧