org.mongodb.morphia.Datastore.ensureIndexes()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(2.5k)|赞(0)|评价(0)|浏览(209)

本文整理了Java中org.mongodb.morphia.Datastore.ensureIndexes()方法的一些代码示例,展示了Datastore.ensureIndexes()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Datastore.ensureIndexes()方法的具体详情如下:
包路径:org.mongodb.morphia.Datastore
类名称:Datastore
方法名:ensureIndexes

Datastore.ensureIndexes介绍

[英]Ensures (creating if necessary) the indexes found during class mapping
[中]确保(必要时创建)在类映射期间找到的索引

代码示例

代码示例来源:origin: protegeproject/webprotege

@Override
public void ensureIndexes() {
  datastore.ensureIndexes(WatchRecord.class);
}

代码示例来源:origin: protegeproject/webprotege

@Override
public void ensureIndexes() {
  datastore.ensureIndexes(UserApiKeys.class);
}

代码示例来源:origin: protegeproject/webprotege

@Override
public void ensureIndexes() {
  datastore.ensureIndexes(SlackWebhook.class);
}

代码示例来源:origin: protegeproject/webprotege

@Override
public void ensureIndexes() {
  datastore.ensureIndexes(UserActivityRecord.class);
}

代码示例来源:origin: protegeproject/webprotege

@Override
public void ensureIndexes() {
  datastore.ensureIndexes(EntityTags.class);
}

代码示例来源:origin: protegeproject/webprotege

@Override
public void ensureIndexes() {
  datastore.ensureIndexes(ApplicationPreferencesStore.class);
}

代码示例来源:origin: protegeproject/webprotege

@Override
public void ensureIndexes() {
  datastore.ensureIndexes(CollectionItemData.class);
}

代码示例来源:origin: stackoverflow.com

Morphia m = ...
Datastore ds = ...

m.map(Product.class);
ds.ensureIndexes(); //creates all defined with @Indexed

代码示例来源:origin: protegeproject/webprotege

@Inject
public EntityDiscussionThreadRepository(@Nonnull Datastore datastore) {
  this.datastore = checkNotNull(datastore);
  this.datastore.ensureIndexes();
}

代码示例来源:origin: org.actframework/act-morphia

private void ensureIndexesAndCaps() {
  ds.ensureIndexes();
  ds.ensureCaps();
}

代码示例来源:origin: stackoverflow.com

final Morphia morphia = new Morphia();

// tell Morphia where to find your classes
// can be called multiple times with different packages or classes
morphia.mapPackage("org.mongodb.morphia.example");

// create the Datastore connecting to the default port on the local host
final Datastore datastore = morphia.createDatastore(new MongoClient(), "morphia_example");
datastore.ensureIndexes();

代码示例来源:origin: de.mhus.lib/mhu-lib-persistence

@SuppressWarnings("rawtypes")
protected void initDatabase() {
  Mapper mapper = createMapper();
  Set<Class> classObjs = new HashSet<>();
  managedTypes = new LinkedList<>();
  schema.findObjectTypes(managedTypes);
  classObjs.addAll(managedTypes);
  morhia = new Morphia(mapper, classObjs );
  datastore = morhia.createDatastore(client, schema.getDatabaseName());
  datastore.ensureIndexes();
}

代码示例来源:origin: BlackLabs/play-morphia

ds().ensureIndexes();

相关文章