com.orientechnologies.orient.core.sql.parser.OBatch Maven / Gradle / Ivy
/* Generated By:JJTree: Do not edit this line. OBatch.java Version 4.3 */
/* JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=true,TRACK_TOKENS=true,NODE_PREFIX=O,NODE_EXTENDS=,NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */
package com.orientechnologies.orient.core.sql.parser;
import com.orientechnologies.orient.core.command.OCommandContext;
import com.orientechnologies.orient.core.exception.OCommandExecutionException;
import java.util.Map;
public class OBatch extends SimpleNode {
protected OInteger num;
protected OInputParameter inputParam;
public OBatch(int id) {
super(id);
}
public OBatch(OrientSql p, int id) {
super(p, id);
}
public Integer evaluate(OCommandContext ctx) {
if (this.num != null) {
return num.getValue().intValue();
} else if (inputParam != null) {
Object obj = inputParam.getValue(ctx.getInputParameters());
if (obj == null || !(obj instanceof Number)) {
throw new OCommandExecutionException("" + obj + " is not a number (BATCH)");
}
return ((Number) obj).intValue();
}
return -1;
}
public void toString(Map