private boolean handleIndexAsTarget(ODeleteExecutionPlan result, OIndexIdentifier indexIdentifier, OWhereClause whereClause, OCommandContext ctx) { if (indexIdentifier == null) { return false; } throw new OCommandExecutionException("DELETE VERTEX FROM INDEX is not supported"); }
private boolean handleIndexAsTarget(ODeleteExecutionPlan result, OIndexIdentifier indexIdentifier, OWhereClause whereClause, OCommandContext ctx, boolean profilingEnabled) { if (indexIdentifier == null) { return false; } throw new OCommandExecutionException("DELETE VERTEX FROM INDEX is not supported"); }
public OExpression getExpandContent() { throw new OCommandExecutionException("Invalid expand expression"); }
public OCommandExecutorSQLAbstract createCommand(final String name) throws OCommandExecutionException { final Class<? extends OCommandExecutorSQLAbstract> clazz = COMMANDS.get(name); if (clazz == null) throw new OCommandExecutionException("Unknown command name :" + name); try { return clazz.newInstance(); } catch (Exception e) { throw OException.wrapException(new OCommandExecutionException("Error in creation of command " + name + "(). Probably there is not an empty constructor or the constructor generates errors"), e); } }
/** * {@inheritDoc} */ public OCommandExecutor createCommand(final String name) throws OCommandExecutionException { final Class<? extends OCommandExecutor> clazz = COMMANDS.get(name); if (clazz == null) { throw new OCommandExecutionException("Unknowned command name :" + name); } try { return clazz.newInstance(); } catch (Exception e) { throw OException.wrapException(new OCommandExecutionException("Error in creation of command " + name + "(). Probably there is not an empty constructor or the constructor generates errors"), e); } }
/** * {@inheritDoc} */ public OCommandExecutorSQLAbstract createCommand(final String name) throws OCommandExecutionException { final Class<? extends OCommandExecutorSQLAbstract> clazz = COMMANDS.get(name); if (clazz == null) { throw new OCommandExecutionException("Unknown command name :" + name); } try { return clazz.newInstance(); } catch (Exception e) { throw OException.wrapException(new OCommandExecutionException("Error in creation of command " + name + "(). Probably there is not an empty constructor or the constructor generates errors"), e); } }
@Override public List<T> run(Object... iArgs) { if (resultListener == null) throw new OCommandExecutionException("Listener not found on asynch query"); return super.run(iArgs); }
public SimpleNode splitForAggregation(AggregateProjectionSplit aggregateProj) { if (isAggregate()) { throw new OCommandExecutionException("Cannot use aggregate functions in array concatenation"); } else { return this; } }
private OResultInternal toOResultInternal(Object x) { if (x instanceof OResultInternal) { return (OResultInternal) x; } if (x instanceof OIdentifiable) { return new OResultInternal((OIdentifiable) x); } throw new OCommandExecutionException("Cannot execute traversal on " + x); } }
public boolean isExpand() { for (OMathExpression expr : this.childExpressions) { if (expr.isExpand()) { if (this.childExpressions.size() > 1) { throw new OCommandExecutionException("Cannot calculate expand() with other expressions"); } return true; } } return false; }
private void validateOutInForEdge(ODocument record, Object currentOut, Object currentIn) { if (!isRecordInstanceOf(currentOut, "V")) { throw new OCommandExecutionException("Error updating edge: 'out' is not a vertex - " + currentOut + ""); } if (!isRecordInstanceOf(currentIn, "V")) { throw new OCommandExecutionException("Error updating edge: 'in' is not a vertex - " + currentIn + ""); } }
private void validateOutInForEdge(ODocument record, Object currentOut, Object currentIn) { if (!isRecordInstanceOf(currentOut, "V")) { throw new OCommandExecutionException("Error updating edge: 'out' is not a vertex - " + currentOut + ""); } if (!isRecordInstanceOf(currentIn, "V")) { throw new OCommandExecutionException("Error updating edge: 'in' is not a vertex - " + currentIn + ""); } }
private void checkNotEdge(OClass oClass) { if (oClass.isSubClassOf("E")) { throw new OCommandExecutionException("Cannot alter class '" + oClass + "' because is an Edge class and could break vertices. Use UNSAFE if you want to force it"); } }
public OResultSet executeInternal(OBasicCommandContext ctx) throws OCommandExecutionException { if (executed) { throw new OCommandExecutionException("Trying to execute a result-set twice. Please use reset()"); } executed = true; OResultSet result = statement.executeDDL(this.ctx); if (result instanceof OInternalResultSet) { ((OInternalResultSet) result).plan = this; } return result; }
public OResultSet executeInternal(OBasicCommandContext ctx) throws OCommandExecutionException { if (executed) { throw new OCommandExecutionException("Trying to execute a result-set twice. Please use reset()"); } executed = true; result = statement.executeSimple(this.ctx); if (result instanceof OInternalResultSet) { ((OInternalResultSet) result).plan = this; } return result; }
public AggregationContext getAggregationContext(OCommandContext ctx) { throw new OCommandExecutionException("Cannot aggregate on " + toString()); }
public void applyRemove(OResultInternal result, OCommandContext ctx) { throw new OCommandExecutionException("Cannot apply REMOVE " + toString()); }
public int getValue(OCommandContext ctx) { if (num != null) { return num.getValue().intValue(); } if (inputParam != null) { Object paramValue = inputParam.getValue(ctx.getInputParameters()); if (paramValue instanceof Number) { return ((Number) paramValue).intValue(); } else { throw new OCommandExecutionException("Invalid value for LIMIT: " + paramValue); } } throw new OCommandExecutionException("No value for LIMIT"); }
public void applyRemove(OResultInternal result, OCommandContext ctx) { if (childExpressions.size() != 1) { throw new OCommandExecutionException("cannot apply REMOVE " + toString()); } childExpressions.get(0).applyRemove(result, ctx); }
@Override public Object execute(final Object iThis, final OIdentifiable iCurrentRecord, final OCommandContext iContext, final Object ioResult, final Object[] iParams) { if (iThis == null) return null; final String algorithm = iParams.length > 0 ? iParams[0].toString() : OSecurityManager.HASH_ALGORITHM; try { return OSecurityManager.createHash(iThis.toString(), algorithm); } catch (NoSuchAlgorithmException e) { throw OException.wrapException(new OCommandExecutionException("hash(): algorithm '" + algorithm + "' is not supported"), e); } catch (UnsupportedEncodingException e) { throw OException.wrapException(new OCommandExecutionException("hash(): encoding 'UTF-8' is not supported"), e); } } }