if (options.withLock()) {
query.append(" ").append(getLockString());
}
// Add on the range
Range range = options.getRange();
if ( supportsRangeInQuery() && options.getRange() != null
&& range.getStart() > 0 && range.getEnd() > 0 ) {
if ( range.getStart() > range.getEnd() ) {
throw new IllegalArgumentException( "The range end (" + range.getEnd() + ") cannot be greater than the start value (" + range.getStart() + ")" );
}
query.append( " " ).append( getRangeString( range ));
}