Package org.jamesii.perfdb

Examples of org.jamesii.perfdb.ConstraintException


    for (IRuntimeConfiguration rtConfig : rtConfigs) {
      if (EqualsCheck.equals(rtConfig.getSelectionTree(), selTree)) {
        if (returnConfig == null) {
          returnConfig = rtConfig;
        } else {
          throw new ConstraintException(
              "There are multiple runtime configurations with identical selection trees!");
        }
      }
    }
View Full Code Here


    List<IProblemScheme> schemes =
        Generics.autoCast(session.createQuery(
            "from ProblemScheme where uri='" + uri.toASCIIString() + "'")
            .list());
    if (schemes.size() > 1) {
      throw new ConstraintException(
          "Ambiguity: there are two probblem schemes that share the same uri ' "
              + uri.toASCIIString() + "'");
    }
    if (schemes.size() == 1) {
      return schemes.get(0);
View Full Code Here

        session.createCriteria(ProblemInstance.class)
            .add(Restrictions.eq("problemDef", problemDefinition))
            .add(Restrictions.eq("randomSeed", randSeed));
    List<IProblemInstance> instances = Generics.autoCast(c.list());
    if (instances.size() > 1) {
      throw new ConstraintException(
          "Ambiguity: there are two problem instances for problem #"
              + problemDefinition.getID() + " with rand seed:" + randSeed);
    }
    if (instances.size() == 1) {
      return instances.get(0);
View Full Code Here

      Class<? extends FeatureExtractorFactory> factory) {
    List<IFeatureType> featTypes =
        Generics.autoCast(session.createCriteria(FeatureType.class)
            .add(Restrictions.eq("featureExtractorFactory", factory)).list());
    if (featTypes.size() > 1) {
      throw new ConstraintException(
          "Ambiguity: there are at least two feature types that share the same factory '"
              + factory + "': #" + featTypes.get(0).getID() + " and #"
              + featTypes.get(1).getID());
    }
    if (featTypes.size() == 1) {
View Full Code Here

    List<IFeature> features =
        Generics.autoCast(session.createCriteria(Feature.class)
            .add(Restrictions.eq(APP_NAME, app))
            .add(Restrictions.eq("featType", featureType)).list());
    if (features.size() > 1) {
      throw new ConstraintException(
          "Ambiguity: there are two feature entries for the same feature type ' "
              + featureType.getName() + "' and application #" + app.getID()
              + ": #" + features.get(0).getID() + " and #"
              + features.get(1).getID());
    }
View Full Code Here

        getEntities("model_id=" + bModel.getID() + " AND parameters='"
            + SerialisationUtils.serializeToB64String((Serializable) params)
            + "'");

    if (simProblems.size() > 1) {
      throw new ConstraintException(
          "There are more than one simulation problems with the same parameters defined for model with id:"
              + bModel.getID());
    }

    return simProblems.size() == 0 ? null : simProblems.get(0);
View Full Code Here

   *           if there are multiple benchmark models with the same URI
   */
  public BenchmarkModel lookUp(URI u) throws SQLException {
    List<BenchmarkModel> bModels = getEntities("URI=" + Databases.toString(u));
    if (bModels.size() > 1) {
      throw new ConstraintException(
          "There are multiple benchmark models with the URI" + u);
    }

    return (bModels.size() == 0 ? null : bModels.get(0));
  }
View Full Code Here

TOP

Related Classes of org.jamesii.perfdb.ConstraintException

Copyright © 2018 www.massapicom. 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.