@DefaultValue("1") @QueryParam("start-index") Long startIndex,
@DefaultValue("10") @QueryParam("max-results") Long maxResults,
@Context UriInfo uriInfo) {
LRepository repository = getRepository(uriInfo);
LTable table = getTable(uriInfo);
List<QName> fieldQNames = ResourceClassUtil.parseFieldList(uriInfo);
RecordId recordId = repository.getIdGenerator().fromString(id);
List<Record> records;
try {
records = table.readVersions(recordId, startIndex, startIndex + maxResults - 1, fieldQNames);
return EntityList.create(records, uriInfo);
} catch (RecordNotFoundException e) {
throw new ResourceException(e, NOT_FOUND.getStatusCode());
} catch (Exception e) {
throw new ResourceException("Error loading record versions.", e, INTERNAL_SERVER_ERROR.getStatusCode());