public void setStandardElementConstraints(boolean allowsPropertyValueNull) { graph.setStandardElementConstraints(allowsPropertyValueNull); }
@SuppressWarnings("unchecked") private void readDatabaseConfiguration() { final ODatabaseDocument databaseDocumentTx = getRawGraph(); final List<OStorageEntryConfiguration> custom = (List<OStorageEntryConfiguration>) databaseDocumentTx.get(ATTRIBUTES.CUSTOM); for (OStorageEntryConfiguration c : custom) { if (c.name.equals("useLightweightEdges")) setUseLightweightEdges(Boolean.parseBoolean(c.value)); else if (c.name.equals("txRequiredForSQLGraphOperations")) // Since v2.2.0 setTxRequiredForSQLGraphOperations(Boolean.parseBoolean(c.value)); else if (c.name.equals("maxRetries")) // Since v2.2.0 setMaxRetries(Integer.parseInt(c.value)); else if (c.name.equals("useClassForEdgeLabel")) setUseClassForEdgeLabel(Boolean.parseBoolean(c.value)); else if (c.name.equals("useClassForVertexLabel")) setUseClassForVertexLabel(Boolean.parseBoolean(c.value)); else if (c.name.equals("useVertexFieldsForEdgeLabels")) setUseVertexFieldsForEdgeLabels(Boolean.parseBoolean(c.value)); else if (c.name.equals("standardElementConstraints")) setStandardElementConstraints(Boolean.parseBoolean(c.value)); } }
@Override public void begin() { ODatabaseDocumentTx documentDatabase = init(); if (documentDatabase == null) { switch (dbType) { case DOCUMENT: documentDatabase = new ODatabaseDocumentTx(dbURL); documentDatabase.open(dbUser, dbPassword); break; case GRAPH: final OrientGraphFactory factory = new OrientGraphFactory(dbURL, dbUser, dbPassword); final OrientBaseGraph graphDatabase = tx ? factory.getTx() : factory.getNoTx(); graphDatabase.setUseLightweightEdges(useLightweightEdges); graphDatabase.setStandardElementConstraints(standardElementConstraints); documentDatabase = graphDatabase.getRawGraph(); pipeline.setGraphDatabase(graphDatabase); break; } pipeline.setDocumentDatabase(documentDatabase); } documentDatabase.declareIntent(new OIntentMassiveInsert()); }
graphDatabase = factory.getNoTx(); graphDatabase.setUseLightweightEdges(useLightweightEdges); graphDatabase.setStandardElementConstraints(standardElementConstraints); pipeline.setGraphDatabase(graphDatabase);