如何使用Massive ORM更新具有组合键的表?

使用Rob Conery的Massive micro-ORM;是否可以使用具有复合键的表?

我不太清楚如何将多个列名分配为“PrimaryKeyField”.有人设法这样做了吗?进一步来说;当主键由两列组成时,如何执行Update()?

最佳答案 在
GitHub上发现此评论;
https://github.com/robconery/massive/pull/50 – 来自Rob的以下评论;

(…) I’ve had this discussion with others (using SubSonic) with
respect to composite keys and to be honest – that’s more code than I’d
like to use to support what I consider an edge case (and not a
terribly good database design outside of many to many joins)

因此似乎不支持复合键.我完全可以看到它背后的原因.幸运的是我们控制着数据库,所以我相信我们可以通过添加代理键来解决它,让当前的复合键成为一个独特的索引.

点赞