当前位置: 首页>>代码示例>>Java>>正文


Java ODocumentInternal类代码示例

本文整理汇总了Java中com.orientechnologies.orient.core.record.impl.ODocumentInternal的典型用法代码示例。如果您正苦于以下问题:Java ODocumentInternal类的具体用法?Java ODocumentInternal怎么用?Java ODocumentInternal使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ODocumentInternal类属于com.orientechnologies.orient.core.record.impl包,在下文中一共展示了ODocumentInternal类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getRawDocument

import com.orientechnologies.orient.core.record.impl.ODocumentInternal; //导入依赖的package包/类
protected ODocument getRawDocument(ORecord record) {
    if (record == null) throw new NoSuchElementException();
    if (record instanceof OIdentifiable)
        record = record.getRecord();
    ODocument currentDocument = (ODocument) record;
    if (currentDocument.getInternalStatus() == ODocument.STATUS.NOT_LOADED)
        currentDocument.load();
    if (ODocumentInternal.getImmutableSchemaClass(currentDocument) == null)
        throw new IllegalArgumentException(
                "Cannot determine the graph element type because the document class is null. Probably this is a projection, use the EXPAND() function");
    return currentDocument;
}
 
开发者ID:orientechnologies,项目名称:orientdb-gremlin,代码行数:13,代码来源:OrientGraph.java

示例2: importGeometry

import com.orientechnologies.orient.core.record.impl.ODocumentInternal; //导入依赖的package包/类
protected void importGeometry(ODatabaseDocumentTx db, String file, final String clazz, String geomClazz) throws IOException {

    OClass points = db.getMetadata().getSchema().createClass(clazz);
    points.createProperty("geometry", OType.EMBEDDED, db.getMetadata().getSchema().getClass(geomClazz));
    final ByteArrayOutputStream out = new ByteArrayOutputStream();
    OIOUtils.copyStream(new FileInputStream(new File(file)), out, -1);
    ODocument doc = new ODocument().fromJSON(out.toString(), "noMap");
    List<ODocument> collection = doc.field("collection");

//    OShapeFactory builder = OShapeFactory.INSTANCE;

    final AtomicLong atomicLong = new AtomicLong(0);

    TimerTask task = new TimerTask() {
      @Override
      public void run() {
        OLogManager.instance().info(this, clazz + " per second [%d]", atomicLong.get());
        atomicLong.set(0);
      }
    };
    Orient.instance().scheduleTask(task, 1000, 1000);
    for (ODocument entries : collection) {
      ODocumentInternal.removeOwner(entries, doc);
      ODocumentInternal.removeOwner(entries, (ORecordElement) collection);
      entries.setClassName(clazz);
      String wkt = entries.field("GeometryWkt");
      try {
//        ODocument location = builder.toDoc(wkt);
//        entries.field("geometry", location, OType.EMBEDDED);
//        db.save(entries);
//
//        atomicLong.incrementAndGet();
      } catch (Exception e) {

      }
    }
    task.cancel();
  }
 
开发者ID:orientechnologies,项目名称:orientdb-lucene,代码行数:39,代码来源:ImportDataFromJson.java


注:本文中的com.orientechnologies.orient.core.record.impl.ODocumentInternal类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。