Examples of SqlResourceException


Examples of org.restsql.core.SqlResourceException

    if (mediaType.equals("application/xml")) {
      return xmlResponseSerializer;
    } else if (mediaType.equals("application/json")) {
      return jsonResponseSerializer;
    } else {
      throw new SqlResourceException("No serializer found for media type " + mediaType);
    }
  }
View Full Code Here

Examples of org.restsql.core.SqlResourceException

      parser.parse(inputStream, handler);
    } catch (final Exception exception) {
      Config.logger.info("Error parsing request body for " + httpAttributes, exception);
      throw new InvalidRequestException("Error parsing request body: " + exception.toString());
    }
    final SqlResourceException handlerException = handler.getHandlerException();
    if (handlerException != null) {
      throw handlerException;
    }
    return handler.getWriteResponse();
  }
View Full Code Here

Examples of org.restsql.core.SqlResourceException

   * @param definition definition
   * @throws SqlResourceException if definition is invalid
   */
  public static void validate(final SqlResourceDefinition definition) throws SqlResourceException {
    if (definition.getQuery() == null) {
      throw new SqlResourceException("Definition requires one query element");
    } else if (definition.getMetadata() == null) {
      throw new SqlResourceException("Definition requires one metadata element");
    } else if (definition.getMetadata().getDatabase() == null
        || definition.getMetadata().getDatabase().getDefault() == null
        || definition.getMetadata().getDatabase().getDefault().length() == 0) {
      throw new SqlResourceException("Definition requires one database element with default name");
    } else if (getTable(definition, TableRole.Parent) == null) {
      throw new SqlResourceException("Definition requires one table element with role Parent");
    } else if (getTableList(definition, TableRole.Parent).size() > 1) {
      throw new SqlResourceException("Definition requires one table element with role Parent");
    } else if (getTableList(definition, TableRole.Child).size() > 1) {
      throw new SqlResourceException("Definition requires one table element with role Child");
    } else if (getTableList(definition, TableRole.Join).size() > 1) {
      throw new SqlResourceException("Definition requires one table element with role Join");
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.