【问题标题】:How can an index be added to an Object Database in Data Nucleus?如何将索引添加到 Data Nucleus 中的对象数据库?
【发布时间】:2010-12-29 22:59:00
【问题描述】:

我在 DataNucleus 下使用 NeoDatis(DB4O 是另一个类似的 Object DB)。

我在 NeoDatis 论坛上看到一篇关于如何在类属性上添加唯一索引的帖子(如下所示):

ODB odb = open("baseName");
ClassRepresentation clazz = db.getClassRepresentation(IndexedObject.class);
String[] indexFields = { "name", "duration" };
clazz.addUniqueIndexOn("index1", indexFields, true);

我现在如何使用 DataNucleus 完成相同的任务?

我是否需要以特定于 DB 的方式来实现这部分,或者有没有办法让它在 DataNucleus 中通用?

【问题讨论】:

    标签: java datanucleus object-oriented-database


    【解决方案1】:

    我被告知(在 DataNucleus 论坛上)该功能将在 3.x 版本中添加,在之前的 2.x 版本中它不是受支持的功能,必须直接使用 NeoDatis 代码来完成。

    【讨论】:

      猜你喜欢
      • 2017-04-26
      • 1970-01-01
      • 1970-01-01
      • 2016-10-30
      • 2014-10-16
      • 1970-01-01
      • 1970-01-01
      • 2020-07-27
      • 1970-01-01
      相关资源
      最近更新 更多