1

是否可以定义非长主键?

动机:我有一组要转换为 rdb 的 XML 文件。字符串属性用作唯一键。

4

1 回答 1

0

Not possible.

From docs:

What should you do when you need to specify the id yourself?

Nothing. You shouldn’t do that. The id property is supposed to be generated and managed by db only. If you need to specify some external unique identifier, like, for instance, Amazon’s ASIN, just add an appropriate field to your entity and specify it as unique on SORM instantiation.

于 2013-04-11T09:15:49.293 回答