use of com.orientechnologies.orient.core.metadata.sequence.OSequence in project orientdb by orientechnologies.
the class OSQLFunctionSequence method execute.
@Override
public Object execute(Object iThis, OIdentifiable iCurrentRecord, Object iCurrentResult, Object[] iParams, OCommandContext iContext) {
final String seqName;
if (configuredParameters[0] instanceof OSQLFilterItem)
seqName = (String) ((OSQLFilterItem) configuredParameters[0]).getValue(iCurrentRecord, iCurrentResult, iContext);
else
seqName = configuredParameters[0].toString();
OSequence result = ODatabaseRecordThreadLocal.INSTANCE.get().getMetadata().getSequenceLibrary().getSequence(seqName);
if (result == null) {
throw new OCommandExecutionException("Sequence not found: " + seqName);
}
return result;
}
Aggregations