使用 objectify,我使用 App Engine 自动生成的 id 为我的实体创建 id,如下所示:
@id
Long ID;
Run Code Online (Sandbox Code Playgroud)
我在变量 ID 中设置了 null,因此 App Engine 会自动为我的实体生成 ID。
通过 objectify 函数创建密钥:
Key.create(java.lang.Class<? extends T> kindClass, long id)
Run Code Online (Sandbox Code Playgroud)
我可以得出结论,为没有任何父关系的实体自动生成的 id 是唯一的吗?