Package org.objectweb.speedo.api

Examples of org.objectweb.speedo.api.SpeedoException


      if ("java.lang.Long".equals(type) || "Long".equals(type)) {
        fieldType = PTypeSpace.OBJLONG;
      } else if ("long".equals(type)) {
        fieldType = PTypeSpace.LONG;
      } else {
                throw new SpeedoException(
                        "Impossible to use an auto incremented identifier: " +
                        "the field type of '" + pkField.name + "' is '" + pkField.type()
                        + "' and 'java.lang.Long' or long is expected (class '"
                        + pkField.moClass.getFQName() + "'.");
            }
View Full Code Here


          if ("java.lang.Long".equals(type) || "Long".equals(type)) {
            fieldType = PTypeSpace.OBJLONG;
          } else if ("long".equals(type)) {
            fieldType = PTypeSpace.LONG;
          } else {
                    throw new SpeedoException(
                            "Impossible to use an auto incremented identifier: " +
                            "the field type of '" + pkField.name + "' is '" + pkField.type()
                            + "' and 'java.lang.Long' or long is expected (class '"
                            + pkField.moClass.getFQName() + "'.");
                }
View Full Code Here

  public void add(Object field, boolean failsOnError, Logger logger)
      throws SpeedoException {
    SpeedoField f = (SpeedoField) field;
    if (fields.containsKey(f.name)) {
      if (failsOnError)
        throw new SpeedoException("The field " + f.name + " of class "
            + name + " is defined twice.");
      else
        logger.log(BasicLevel.ERROR, "The field " + f.name
            + " of class " + name + " is defined twice.");
    } else {
View Full Code Here

  public void addFetchGroup(Object fetchGroup, boolean failsOnError,
      Logger logger) throws SpeedoException {
    SpeedoFetchGroup fg = (SpeedoFetchGroup) fetchGroup;
    if (fetchGroups.containsKey(fg.name)) {
      if (failsOnError)
        throw new SpeedoException("The fetchgroup " + fg.name
            + " of class " + name + " is defined twice.");
      else
        logger.log(BasicLevel.ERROR, "The fetchgroup " + fg.name
            + " of class " + name + " is defined twice.");
    } else {
View Full Code Here

      if (getSuper() != null) {
        return getSuper().getUniquePKField();
      }
      return null;
    } else if (s > 1) {
      throw new SpeedoException(
          "several fields have been marked as primary-key "
              + al + " in the " + getSourceDesc() + ".");
    }
    return (SpeedoField) al.get(0);
  }
View Full Code Here

                    logger.log(BasicLevel.DEBUG,
                            "JormExtent: " + je + " / pcm=" + pcm);
                }
                je.setPMapper(pcm.getPMapper(), pcm.getProjectName());
            } catch (PException e) {
                throw new SpeedoException(
                        "Error while fetching PClassPMapping of the class "
                        + je.getJormName(), e);
            }
        }
    }
View Full Code Here

    public void visit(JDOQueryDefinitionImpl qd)
            throws SpeedoException {
        try {
            _visit(qd);
        } catch (ExpressionException e) {
            throw new SpeedoException(e);
        } catch (MedorException e) {
            throw new SpeedoException(e);
        }
    }
View Full Code Here

            break;
        default:
            className = ptype.getJavaName();
        }
        if (className == null) {
            throw new SpeedoException(
                    "Type '" + ptype.getJavaName()
                    + "' not found for projected field:"
                    + field.getName());
        } else {
            try {
                return classloader.loadClass(className);
            } catch (ClassNotFoundException e) {
                throw new SpeedoException(
                        "Type '" + className
                        + "' not found for projected field:"
                        + field.getName(), e);
            }
        }
View Full Code Here

                    //not the end of the selected field
                    stack.push(o2);
                    stack.push(o1);
                } else  if (!(o1 instanceof String)
                        || !(o2 instanceof Expression)) {
                    throw new SpeedoException(
                            "Malformed selected field "
                                    + (selectfields.size() + 1));
                } else {
                  selectfields.add(o2);
                  aliases.add(o1);
                }
            } else {
                //without an alias
                selectfields.add(o1);
                aliases.add(null);
            }
        } else {
            throw new SpeedoException(
                    "Empty definition of the selected field "
                            + (selectfields.size() + 1));
        }
    }   
View Full Code Here

        } while (isOperand);
        Expression e;
        //Verify the operand number
        if (functionIdx.intValue() > 0 && functionIdx.intValue() < 10) {
            if (operands.size() != 1) {
                throw new SpeedoException(
                        "Bad number of operand for the function "
                                + getFunctionAsString(functionIdx
                                        .intValue())
                                + ", expected 1 operand, found "
                                + operands.size());
            }
        }
        //instanciate the medor Operator corresponding to the function
        Object operand = operands.get(0);
        if (operand instanceof Expression) {
            e = (Expression) operand;
        } else if (operand instanceof Field) {
            e = new BasicFieldOperand((Field) operand);
        } else {
            throw new SpeedoException("Unexpect operand: " + operand);
        }
        getFieldsFromExpression(e, groupedFields);
        hasAggregate = true;
        switch (functionIdx.intValue() / 2) {
        case 0:
            e = new Count(e, distinctOnOperand);
            break;
        case 1:
            e = new Sum(e, distinctOnOperand);
            break;
        case 2:
            e = new Min(e, distinctOnOperand);
            break;
        case 3:
            e = new Max(e, distinctOnOperand);
            break;
        case 4:
            e = new Avg(e, distinctOnOperand);
            break;
        default:
            throw new SpeedoException("Unknown function identifier: "
                    + functionIdx.intValue());
        }
        stack.push(e);
    }
View Full Code Here

TOP

Related Classes of org.objectweb.speedo.api.SpeedoException

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.