本文整理汇总了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;
}
示例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);
}