* This method discerns between classes marked with the {@link TableEnabled} annotation and those without.
* @param uriInfo context info from the incoming request
* @return the appropriate table (based on the tableName parameter, or the default table)
*/
protected LTable getTable(UriInfo uriInfo) {
LRepository repository = getRepository(uriInfo);
try {
TableEnabled tableEnabledAnnotation = getClass().getAnnotation(TableEnabled.class);
if (tableEnabledAnnotation != null) {
return repository.getTable(uriInfo.getPathParameters().getFirst(tableEnabledAnnotation.tableName()));
} else {
return repository.getDefaultTable();
}
} catch (Exception e) {
ExceptionUtil.handleInterrupt(e);
throw new ResourceException("Error retrieving table", e, INTERNAL_SERVER_ERROR.getStatusCode());
}