public synchronized void load(final ODatabaseDocumentInternal db) { sequences.clear(); if (db.getMetadata().getImmutableSchemaSnapshot().existsClass(OSequence.CLASS_NAME)) { try (final OResultSet result = db.query("SELECT FROM " + OSequence.CLASS_NAME)) { while (result.hasNext()) { OResult res = result.next(); final OSequence sequence = OSequenceHelper.createSequence((ODocument) res.getElement().get()); sequences.put(sequence.getName().toUpperCase(Locale.ENGLISH), sequence); } } } }
public void load(ODatabaseDocumentInternal db) { // COPY CALLBACK IN RAM final Map<String, OCallable<Object, Map<Object, Object>>> callbacks = new HashMap<String, OCallable<Object, Map<Object, Object>>>(); for (Map.Entry<String, OFunction> entry : functions.entrySet()) { if (entry.getValue().getCallback() != null) callbacks.put(entry.getKey(), entry.getValue().getCallback()); } functions.clear(); // LOAD ALL THE FUNCTIONS IN MEMORY if (db.getMetadata().getImmutableSchemaSnapshot().existsClass("OFunction")) { try(OResultSet result = db.query("select from OFunction order by name")) { while (result.hasNext()) { OResult res = result.next(); ODocument d = (ODocument) res.getElement().get(); //skip the function records which do not contain real data if (d.fields() == 0) continue; final OFunction f = new OFunction(d); // RESTORE CALLBACK IF ANY f.setCallback(callbacks.get(f.getName())); functions.put(d.field("name").toString().toUpperCase(Locale.ENGLISH), f); } } } }
return getDefaultClusterId(); case TYPE: return getMetadata().getImmutableSchemaSnapshot().existsClass("V") ? "graph" : "document"; case DATEFORMAT: return storage.getConfiguration().getDateFormat();