org.bonitasoft.engine.bdm.model.Query.getQueryParameters()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(6.5k)|赞(0)|评价(0)|浏览(106)

本文整理了Java中org.bonitasoft.engine.bdm.model.Query.getQueryParameters方法的一些代码示例,展示了Query.getQueryParameters的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.getQueryParameters方法的具体详情如下:
包路径:org.bonitasoft.engine.bdm.model.Query
类名称:Query
方法名:getQueryParameters

Query.getQueryParameters介绍

暂无

代码示例

代码示例来源:origin: bonitasoft/bonita-engine

/**
 * Verifies that the actual Query has no queryParameters.
 * @return this assertion object.
 * @throws AssertionError if the actual Query's queryParameters is not empty.
 */
public QueryAssert hasNoQueryParameters() {
 // check that actual Query we want to make assertions on is not null.
 isNotNull();
 // we override the default error message with a more explicit one
 String assertjErrorMessage = "\nExpected :\n  <%s>\nnot to have queryParameters but had :\n  <%s>";
 
 // check
 if (actual.getQueryParameters().iterator().hasNext()) {
  failWithMessage(assertjErrorMessage, actual, actual.getQueryParameters());
 }
 
 // return the current assertion for method chaining
 return this;
}

代码示例来源:origin: bonitasoft/bonita-engine

private Set<Object> buildModelTree(final BusinessObjectModel bom) {
  final Set<Object> objectsToValidate = new HashSet<>();
  objectsToValidate.add(bom);
  for (final BusinessObject bo : bom.getBusinessObjects()) {
    objectsToValidate.add(bo);
    objectsToValidate.addAll(bo.getFields());
    final List<UniqueConstraint> uniqueConstraints = bo.getUniqueConstraints();
    objectsToValidate.addAll(uniqueConstraints);
    final List<Query> queries = bo.getQueries();
    for (final Query q : queries) {
      objectsToValidate.add(q);
      objectsToValidate.addAll(q.getQueryParameters());
    }
    objectsToValidate.addAll(bo.getIndexes());
  }
  return objectsToValidate;
}

代码示例来源:origin: bonitasoft/bonita-engine

private Set<Object> buildModelTree(final BusinessObjectModel bom) {
  final Set<Object> objectsToValidate = new HashSet<>();
  objectsToValidate.add(bom);
  for (final BusinessObject bo : bom.getBusinessObjects()) {
    objectsToValidate.add(bo);
    objectsToValidate.addAll(bo.getFields());
    final List<UniqueConstraint> uniqueConstraints = bo.getUniqueConstraints();
    objectsToValidate.addAll(uniqueConstraints);
    final List<Query> queries = bo.getQueries();
    for (final Query q : queries) {
      objectsToValidate.add(q);
      objectsToValidate.addAll(q.getQueryParameters());
    }
    objectsToValidate.addAll(bo.getIndexes());
  }
  return objectsToValidate;
}

代码示例来源:origin: bonitasoft/bonita-engine

private Map<String, Serializable> getQueryParameters(final Query queryDefinition, final Map<String, Serializable> parameters)
    throws SBusinessDataRepositoryException {
  final Set<String> errors = new HashSet<>();
  final Map<String, Serializable> queryParameters = new HashMap<>();
  for (final QueryParameter queryParameter : queryDefinition.getQueryParameters()) {
    if (parameters != null && parameters.containsKey(queryParameter.getName())) {
      queryParameters.put(queryParameter.getName(),
          convertToType(loadSerializableClass(queryParameter.getClassName()), parameters.get(queryParameter.getName())));
    } else {
      errors.add(queryParameter.getName());
    }
  }
  if (!errors.isEmpty()) {
    final StringBuilder errorMessage = new StringBuilder().append("parameter(s) are missing for query named ").append(queryDefinition.getName())
        .append(" : ");
    errorMessage.append(StringUtils.join(errors, ","));
    throw new SBusinessDataRepositoryException(errorMessage.toString());
  }
  return queryParameters;
}

代码示例来源:origin: bonitasoft/bonita-engine

private Map<String, Serializable> getQueryParameters(final Query queryDefinition, final Map<String, Serializable> parameters)
    throws SBusinessDataRepositoryException {
  final Set<String> errors = new HashSet<>();
  final Map<String, Serializable> queryParameters = new HashMap<>();
  for (final QueryParameter queryParameter : queryDefinition.getQueryParameters()) {
    if (parameters != null && parameters.containsKey(queryParameter.getName())) {
      queryParameters.put(queryParameter.getName(),
          convertToType(loadSerializableClass(queryParameter.getClassName()), parameters.get(queryParameter.getName())));
    } else {
      errors.add(queryParameter.getName());
    }
  }
  if (!errors.isEmpty()) {
    final StringBuilder errorMessage = new StringBuilder().append("parameter(s) are missing for query named ").append(queryDefinition.getName())
        .append(" : ");
    errorMessage.append(StringUtils.join(errors, ","));
    throw new SBusinessDataRepositoryException(errorMessage.toString());
  }
  return queryParameters;
}

代码示例来源:origin: bonitasoft/bonita-engine

/**
 * Verifies that the actual Query's queryParameters contains the given QueryParameter elements.
 * @param queryParameters the given elements that should be contained in actual Query's queryParameters.
 * @return this assertion object.
 * @throws AssertionError if the actual Query's queryParameters does not contain all given QueryParameter elements.
 */
public QueryAssert hasQueryParameters(QueryParameter... queryParameters) {
 // check that actual Query we want to make assertions on is not null.
 isNotNull();
 // check that given QueryParameter varargs is not null.
 if (queryParameters == null) throw new AssertionError("Expecting queryParameters parameter not to be null.");
 
 // check with standard error message, to set another message call: info.overridingErrorMessage("my error message");
 Iterables.instance().assertContains(info, actual.getQueryParameters(), queryParameters);
 // return the current assertion for method chaining
 return this;
}

代码示例来源:origin: bonitasoft/bonita-engine

public BusinessObjectBuilder withQuery(final Query query) {
  final Query addQuery = businessObject.addQuery(query.getName(), query.getContent(), query.getReturnType());
  for (final QueryParameter qP : query.getQueryParameters()) {
    addQuery.addQueryParameter(qP.getName(), qP.getClassName());
  }
  return this;
}

代码示例来源:origin: bonitasoft/bonita-engine

protected JMethod createMethodForQuery(final JDefinedClass entity, final JDefinedClass targetClass, final Query query) {
  final String methodName = query.getName();
  final JMethod queryMethod = createQueryMethod(entity, targetClass, methodName, query.getReturnType());
  for (final QueryParameter param : query.getQueryParameters()) {
    queryMethod.param(getModel().ref(param.getClassName()), param.getName());
  }
  addOptionalPaginationParameters(queryMethod, query);
  return queryMethod;
}

代码示例来源:origin: bonitasoft/bonita-engine

protected JMethod createMethodForQuery(final JDefinedClass entity, final JDefinedClass targetClass, final Query query) {
  final String methodName = query.getName();
  final JMethod queryMethod = createQueryMethod(entity, targetClass, methodName, query.getReturnType());
  for (final QueryParameter param : query.getQueryParameters()) {
    queryMethod.param(getModel().ref(param.getClassName()), param.getName());
  }
  addOptionalPaginationParameters(queryMethod, query);
  return queryMethod;
}

相关文章