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


Java ODocument.setClassName方法代码示例

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


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

示例1: createItem

import com.orientechnologies.orient.core.record.impl.ODocument; //导入方法依赖的package包/类
private ODocument createItem(int id, ODocument doc)
{
    String itemKey = Integer.valueOf(id).toString();

    doc.setClassName("Item");
    doc.field("stringKey", itemKey);
    doc.field("intKey", id);
    String contents = "OrientDB is a deeply scalable Document-Graph DBMS with the flexibility of the Document databases and the power to manage links of the Graph databases. " + "It can work in schema-less mode, schema-full or a mix of both. Supports advanced features such as ACID Transactions, Fast Indexes, Native and SQL queries." + " It imports and exports documents in JSON." + " Graphs of hundreads of linked documents can be retrieved all in memory in few milliseconds without executing costly JOIN such as the Relational DBMSs do. " + "OrientDB uses a new indexing algorithm called MVRB-Tree, derived from the Red-Black Tree and from the B+Tree with benefits of both: fast insertion and ultra fast lookup. " + "The transactional engine can run in distributed systems supporting up to 9.223.372.036 Billions of records for the maximum capacity of 19.807.040.628.566.084 Terabytes of data distributed on multiple disks in multiple nodes. " + "OrientDB is FREE for any use. Open Source License Apache 2.0. ";
    doc.field("text", contents);
    doc.field("title", "orientDB");
    doc.field("length", contents.length());
    doc.field("published", (id % 2 > 0));
    doc.field("author", "anAuthor" + id);
    // doc.field("tags", asList("java", "orient", "nosql"), OType.EMBEDDEDLIST);
    Calendar instance = Calendar.getInstance(TimeZone.getTimeZone("UTC"));

    instance.add(Calendar.HOUR_OF_DAY, -id);
    Date time = instance.getTime();
    doc.field("date", time, OType.DATE);
    doc.field("time", time, OType.DATETIME);

    return doc;
}
 
开发者ID:geekflow,项目名称:light,代码行数:24,代码来源:OrientJdbcTest.java

示例2: loadDB

import com.orientechnologies.orient.core.record.impl.ODocument; //导入方法依赖的package包/类
private void loadDB(ODatabaseDocumentTx db, int documents) throws IOException
{
    db.declareIntent(new OIntentMassiveInsert());

    for (int i = 1; i <= documents; i++)
    {
        ODocument doc = new ODocument();
        doc.setClassName("Item");
        doc = createItem(i, doc);
        db.save(doc, "Item");

    }

    db.declareIntent(null);
}
 
开发者ID:geekflow,项目名称:light,代码行数:16,代码来源:OrientJdbcTest.java


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