當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。