@Override public <RET extends ORecord> RET fromJSON(String iJson) { element.fromJSON(iJson); return (RET) this; }
@Override public ODocument getConfiguration() { return new ODocument().fromJSON("{parameters:[{driver:{optional:false,description:'JDBC Driver class'}}," + "{url:{optional:false,description:'Connection URL'}}," + "{userName:{optional:false,description:'User name'}}," + "{userPassword:{optional:false,description:'User password'}}," + "{fetchSize:{optional:true,description:'JDBC cursor fetch size. Default is 10000'}}," + "{query:{optional:false,description:'Query that extract records'}}," + "{queryCount:{optional:true,description:'Query that returns the count to have a correct progress status'}}]," + "output:'ODocument'}"); }
@Override public <RET extends ORecord> RET fromJSON(String iJson) { if (element == null) { promoteToRegularEdge(); } element.fromJSON(iJson); return (RET) this; }
private ODocument fromJSON(String input,OrientDBEndpoint endpoint,ODatabase<?> db){ ODocument out = new ODocument(); out.fromJSON(input); return out; }
@Override public ODocument getConfiguration() { return new ODocument().fromJSON( "{parameters:[{name:{optional:false,description:'Variable name'}}," + "{value:{optional:true,description:'Variable value'}}" + "{expression:{optional:true,description:'Expression to evaluate'}}" + "]}"); }
@Override public ODocument getConfiguration() { return new ODocument().fromJSON("{parameters:[{language:{optional:true,description:'Code language, default is Javascript'}}," + "{code:{optional:false,description:'Code to execute'}}]," + "input:['Object'],output:'Object'}"); }
private ODocument getMetadata(OExpression[] args) { if (args.length == 2) { return new ODocument().fromJSON(args[1].toString()); } return OLuceneQueryBuilder.EMPTY_METADATA; }
@Override public ODocument getConfiguration() { return new ODocument().fromJSON( "{parameters:[" + getCommonConfigurationParameters() + "," + "{block:{optional:false,description:'Block to execute'}}]}"); }
@Override public ODocument getConfiguration() { return new ODocument().fromJSON("{parameters:[" + getCommonConfigurationParameters() + "," + "{language:{optional:true,description:'Command language, SQL by default'}}," + "{command:{optional:false,description:'Command to execute'}}]," + "input:['ODocument'],output:'ODocument'}"); }
@Override public ODocument getConfiguration() { return new ODocument().fromJSON("{parameters:[" + getCommonConfigurationParameters() + "{file:{optional:true,description:'Input filename with commands.sh to execute'}}" + "{commands.sh:{optional:true,description:'Commands to execute in sequence as an array of strings'}}" + "]}"); }
private ODocument parseMetadata(OExpression[] args) { ODocument metadata = new ODocument(); if (args.length == 2) { metadata.fromJSON(args[1].toString()); } return metadata; }
@Override public ODocument getConfiguration() { return new ODocument().fromJSON("{parameters:[" + getCommonConfigurationParameters() + "," + "{fieldName:{optional:true,description:'field name to apply the result'}}," + "{fieldNames:{optional:true,description:'field names to apply the result'}}," + "{expression:{optional:true,description:'expression to evaluate. Mandatory with operation=set (default)'}}" + "{value:{optional:true,description:'value to set'}}" + "{operation:{optional:false,description:'operation to execute against the field: set, remove. Default is set'}}" + "{save:{optional:true,description:'save the vertex/edge/document right after the setting of the field'}}" + "]," + "input:['ODocument'],output:'ODocument'}"); }
@Override public ODocument getConfiguration() { return new ODocument().fromJSON("{parameters:[" + getCommonConfigurationParameters() + "," + "{language:{optional:true,description:'Code language, default is Javascript'}}," + "{code:{optional:false,description:'Code to execute'}}" + "]}"); }
@Override public ODocument getConfiguration() { return new ODocument().fromJSON("{parameters:[" + getCommonConfigurationParameters() + "," + "{prefix:{optional:true,description:'Custom prefix to prepend to the message'}}," + "{postfix:{optional:true,description:'Custom postfix to append to the message'}}" + "]}"); }
@Override public ODocument getConfiguration() { return new ODocument().fromJSON("{parameters:[" + getCommonConfigurationParameters() + "{file:{optional:true,description:'Input filename with commands to execute'}}" + "{commands:{optional:true,description:'Commands to execute in sequence as an array of strings'}}" + "]}"); }
private ODocument getMetadata(OExpression[] args) { if (args.length == 3) { return new ODocument().fromJSON(args[2].toString()); } return new ODocument(); }
protected void parseMerge() { if (!parserIsEnded() && !parserGetLastWord().equals(KEYWORD_WHERE)) { final String contentAsString = parserRequiredWord(false, "document to merge expected").trim(); merge = new ODocument().fromJSON(contentAsString); parserSkipWhiteSpaces(); } if (merge == null) throwSyntaxErrorException("Document to merge not provided. Example: MERGE { \"name\": \"Jay\" }"); }
@Override protected ODocument execute(ODatabaseDocument db) { ODocument doc = new ODocument(); doc.fromJSON(json); Long dateTime = doc.field("dateTime", Long.class); doc.field("dateTime", new Date(dateTime)); doc.setClassName(OLoggerModule.OLOGGER_EVENT_OCLASS); doc.save(); return doc; } }.execute();
@Override public ODocument getConfiguration() { return new ODocument().fromJSON("{parameters:[" + getCommonConfigurationParameters() + "," + "{joinFieldName:{optional:true,description:'field name containing the value to join'}}," + "{joinValue:{optional:true,description:'value to use in lookup query'}}," + "{linkFieldName:{optional:false,description:'field name containing the link to set'}}," + "{linkFieldType:{optional:true,description:'field type containing the link to set. Use LINK for single link and LINKSET or LINKLIST for many'}}," + "{lookup:{optional:false,description:'<Class>.<property> or Query to execute'}}," + "{unresolvedLinkAction:{optional:true,description:'action when a unresolved link is found',values:" + stringArray2Json( ACTION.values()) + "}}]," + "input:['ODocument'],output:'ODocument'}"); }
@Override public ODocument getConfiguration() { return new ODocument().fromJSON("{parameters:[" + getCommonConfigurationParameters() + "," + "{joinFieldName:{optional:false,description:'field name containing the value to join'}}," + "{lookup:{optional:false,description:'<Class>.<property> or Query to execute'}}," + "{unresolvedLinkAction:{optional:true,description:'action when a unresolved link is found',values:" + stringArray2Json( ACTION.values()) + "}}]," + "input:['ODocument'],output:'ODocument'}"); }