使用 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)
所以似乎不支持复合键。我完全可以看到它背后的原因。幸运的是我们可以控制数据库,所以我相信我们可以通过添加一个代理键来解决它,让当前的组合键变成一个唯一的索引。
关于massive - 如何使用 Massive ORM 更新带有复合键的表?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9498590/