Search in sources :

Example 31 with OIntentMassiveInsert

use of com.orientechnologies.orient.core.intent.OIntentMassiveInsert in project orientdb by orientechnologies.

the class OrientDbCreationHelper method loadDB.

public static 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);
    createAuthorAndArticles(db, 50, 50);
    createArticleWithAttachmentSplitted(db);
    createWriterAndPosts(new OrientGraphNoTx(db), 10, 10);
}
Also used : OrientGraphNoTx(com.tinkerpop.blueprints.impls.orient.OrientGraphNoTx) OIntentMassiveInsert(com.orientechnologies.orient.core.intent.OIntentMassiveInsert) ODocument(com.orientechnologies.orient.core.record.impl.ODocument)

Aggregations

OIntentMassiveInsert (com.orientechnologies.orient.core.intent.OIntentMassiveInsert)31 ODatabaseDocumentTx (com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx)14 ODocument (com.orientechnologies.orient.core.record.impl.ODocument)8 ArrayList (java.util.ArrayList)7 ORID (com.orientechnologies.orient.core.id.ORID)5 OrientMonoThreadTest (com.orientechnologies.orient.test.database.base.OrientMonoThreadTest)5 Test (org.junit.Test)5 Test (org.testng.annotations.Test)5 Future (java.util.concurrent.Future)4 OCommandOutputListener (com.orientechnologies.orient.core.command.OCommandOutputListener)3 OIdentifiable (com.orientechnologies.orient.core.db.record.OIdentifiable)3 ODatabaseCompare (com.orientechnologies.orient.core.db.tool.ODatabaseCompare)3 ORecordBytes (com.orientechnologies.orient.core.record.impl.ORecordBytes)3 OStorage (com.orientechnologies.orient.core.storage.OStorage)3 OrientVertex (com.tinkerpop.blueprints.impls.orient.OrientVertex)3 OException (com.orientechnologies.common.exception.OException)2 ODatabaseDocumentInternal (com.orientechnologies.orient.core.db.ODatabaseDocumentInternal)2 ODatabaseDocument (com.orientechnologies.orient.core.db.document.ODatabaseDocument)2 ORidBag (com.orientechnologies.orient.core.db.record.ridbag.ORidBag)2 OCommandExecutionException (com.orientechnologies.orient.core.exception.OCommandExecutionException)2