congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
JPQLException
Code IndexAdd Tabnine to your IDE (free)

How to use
JPQLException
in
org.eclipse.persistence.exceptions

Best Java code snippets using org.eclipse.persistence.exceptions.JPQLException (Showing top 20 results out of 315)

origin: org.eclipse.persistence/org.eclipse.persistence.core

public static JPQLException aliasResolutionException(String query, int line, int column, String theAlias) {
  Object[] args = { query, line, column, theAlias };
  String message = ExceptionMessageGenerator.buildMessage(JPQLException.class, aliasResolutionException, args);
  JPQLException exception = new JPQLException(message);
  exception.setErrorCode(aliasResolutionException);
  return exception;
}
origin: org.eclipse.persistence/org.eclipse.persistence.core

  /**
   * PUBLIC
   * Print the stack trace for each error generated by the
   * parser. This method is intended to assist in debugging
   * problems in EJBQL
   */
  public void printFullStackTrace() {
    if (hasInternalExceptions()) {
      Iterator exceptions = getInternalExceptions().iterator();
      while (exceptions.hasNext()) {
        Throwable error = (Throwable)exceptions.next();
        error.printStackTrace();
      }
    }
  }
}
origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

if (type == null) {
  throw JPQLException.unknownAttribute(
    context.getQueryInfo(), right.getLine(), right.getColumn(), 
    name, typeHelper.getTypeName(left.getType()));
  enumConstant = typeHelper.resolveEnumConstant(type, name);
  if (enumConstant == null) {
    throw JPQLException.invalidEnumLiteral(context.getQueryInfo(),
      right.getLine(), right.getColumn(), typeName, name);
  throw JPQLException.aliasResolutionException(
    context.getQueryInfo(), leftMost.getLine(), 
    leftMost.getColumn(), leftMost.getAsString());
origin: org.eclipse.persistence/org.eclipse.persistence.core

public Object getTypeForMapKey(ParseTreeContext context){
  String name = getCanonicalVariableName();
  if (context.isRangeVariable(name)) {
    throw JPQLException.variableCannotHaveMapKey(context.getQueryInfo(), getLine(), getColumn(), name);
  } else {
    DotNode path = (DotNode)context.pathForVariable(name);
    if (path == null) {
      throw JPQLException.aliasResolutionException(
        context.getQueryInfo(), getLine(), getColumn(), name);
    } else {
      return path.getTypeForMapKey(context);
    }
  }
}
origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

/** 
 * INTERNAL
 * Answer the class associated with the provided schema name
 */
public Class classForSchemaName(String schemaName, GenerationContext context) {
  ClassDescriptor descriptor = context.getSession().getDescriptorForAlias(schemaName);
  if (descriptor == null) {
    throw JPQLException.entityTypeNotFound(getQueryInfo(), schemaName);
  }
  Class theClass = descriptor.getJavaClass();
  if (theClass == null) {
    throw JPQLException.resolutionClassNotFoundException(getQueryInfo(), schemaName);
  }
  return theClass;
}
origin: org.eclipse.persistence/org.eclipse.persistence.core

/**
 * INTERNAL
 * Generate an exception which encapsulates all the exceptions generated
 * by this parser. Special case where the first exception is an
 * JPQLException.
 */
protected JPQLException generateException() {
  //Handle exceptions we expect (such as expressionSotSupported)
  Exception firstException = (Exception)getErrors().get(0);
  if (firstException instanceof JPQLException) {
    return (JPQLException)firstException;
  }
  //Handle general exceptions, such as NPE
  JPQLException exception =
    JPQLException.generalParsingException(getQueryInfo());
  exception.setInternalExceptions(getErrors());
  return exception;
}
origin: com.haulmont.thirdparty/eclipselink

  /**
   * resolveClass: Answer the class which corresponds to my variableName. This is the class for
   * an alias, where the variableName is registered to an alias.
   */
  public Class resolveClass(GenerationContext context) {
    String alias = abstractSchemaName;
    ClassDescriptor descriptor = context.getSession().getDescriptorForAlias(alias);
    if (descriptor == null) {
      throw JPQLException.entityTypeNotFound2(
        context.getParseTreeContext().getQueryInfo(), 
        getLine(), getColumn(), alias);
    }
    Class theClass = descriptor.getJavaClass();
    if (theClass == null) {
      throw JPQLException.resolutionClassNotFoundException2(
        context.getParseTreeContext().getQueryInfo(), 
        getLine(), getColumn(), alias);
    }
    return theClass;
  }
}
origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

/**
 * INTERNAL
 * Validate node and calculate its type.
 */
public void validate(ParseTreeContext context) {
  TypeHelper typeHelper = context.getTypeHelper();
  if (orderNode == null){
    if (orderByItem instanceof Node){
      orderNode = (Node)orderByItem;
    } else {
      orderNode = context.pathForVariable((String)orderByItem);
      if (orderNode == null){
        throw JPQLException.nonExistantOrderByAlias(
            context.getQueryInfo(), getLine(), getColumn(), 
            (String)orderByItem);
      }
    }
  }
  if (orderNode != null) {
    orderNode.validate(context);
    Object type = orderNode.getType();
    setType(type);
    if (!typeHelper.isOrderableType(type)) {
      throw JPQLException.expectedOrderableOrderByItem(
        context.getQueryInfo(), orderNode.getLine(), orderNode.getColumn(), 
        orderNode.getAsString(), typeHelper.getTypeName(type));
    }
  }
}
origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

/**
 * resolveClass: Answer the class which corresponds to my variableName. This is the class for
 * an alias, where the variableName is registered to an alias.
 */
public Class resolveClass(GenerationContext generationContext) {
  Class clazz = null;
  String name = getCanonicalVariableName();
  ParseTreeContext context = generationContext.getParseTreeContext();
  if (context.isRangeVariable(name)) {
    String schema = context.schemaForVariable(name);
    clazz = context.classForSchemaName(schema, generationContext);
  } else {
    DotNode path = (DotNode)context.pathForVariable(name);
    if (path == null) {
      throw JPQLException.aliasResolutionException(
        context.getQueryInfo(), getLine(), getColumn(), name);
    } else {
      clazz = path.resolveClass(generationContext);
    }
  }
  return clazz;
}
origin: com.haulmont.thirdparty/eclipselink

/**
 * INTERNAL
 * Add an internal Exception to the collection of
 * internal Exceptions
 */
public Object addInternalException(Object theException) {
  getInternalExceptions().add(theException);
  return theException;
}
origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

/**
 * INTERNAL
 * Add the exception to the list of errors.
 */
public void addError(Exception e) {
  if (e instanceof RecognitionException) {
    e = handleRecognitionException((RecognitionException)e);
  } else if (!(e instanceof JPQLException)) {
    e = JPQLException.generalParsingException(getQueryInfo(), e);
  }
  errors.add(e);
}
origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

  public void validate(ParseTreeContext context) {
    TypeHelper typeHelper = context.getTypeHelper();
    left.validate(context);
    if (!left.isVariableNode()){
      throw JPQLException.indexOnlyAllowedOnVariable(context.getQueryInfo(), getLine(), getColumn(), left.getAsString());
    }
    setType(typeHelper.getIntType());
  }
}
origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

/**
 * Check the specifid constructor class and return its class instance. 
 * @exception JPQLException if the specified constructor class could not
 * be found.
 */
private Class getConstructorClass(ParseTreeContext context) {
  Object type = getType();
  if (type == null) {
    throw JPQLException.constructorClassNotFound(
      context.getQueryInfo(), getLine(), getColumn(), className);
  }
  return (Class)type;
}
origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

  /**
   * INTERNAL
   * Validate node and calculate its type.
   */
  public void validate(ParseTreeContext context) {
    super.validate(context);
    TypeHelper typeHelper = context.getTypeHelper();
    Object type = typeHelper.resolveSchema(abstractSchemaName);
    if (type == null) {
      throw JPQLException.entityTypeNotFound2(
        context.getQueryInfo(), getLine(), getColumn(), abstractSchemaName);
    }
    setType(type);
  }
}
origin: org.eclipse.persistence/org.eclipse.persistence.core

private JPQLException buildUnexpectedException(CharSequence jpqlQuery, Exception exception) {
  String errorMessage = resourceBundle().getString(HermesParser_UnexpectedException_ErrorMessage);
  errorMessage = MessageFormat.format(errorMessage, jpqlQuery);
  return new JPQLException(errorMessage, exception);
}
origin: com.haulmont.thirdparty/eclipselink

throw JPQLException.unknownAttribute(
  context.getQueryInfo(), right.getLine(), right.getColumn(), 
  name, typeHelper.getTypeName(left.getType()));
enumConstant = typeHelper.resolveEnumConstant(type, name);
if (enumConstant == null) {
  throw JPQLException.invalidEnumLiteral(context.getQueryInfo(),
    right.getLine(), right.getColumn(), typeName, name);
throw JPQLException.aliasResolutionException(
  context.getQueryInfo(), leftMost.getLine(), 
  leftMost.getColumn(), leftMost.getAsString());
origin: com.haulmont.thirdparty/eclipselink

public Object getTypeForMapKey(ParseTreeContext context){
  String name = getCanonicalVariableName();
  if (context.isRangeVariable(name)) {
    throw JPQLException.variableCannotHaveMapKey(context.getQueryInfo(), getLine(), getColumn(), name);
  } else {
    DotNode path = (DotNode)context.pathForVariable(name);
    if (path == null) {
      throw JPQLException.aliasResolutionException(
        context.getQueryInfo(), getLine(), getColumn(), name);
    } else {
      return path.getTypeForMapKey(context);
    }
  }
}
origin: org.eclipse.persistence/org.eclipse.persistence.core

/**
 * INTERNAL
 * Answer the class associated with the provided schema name
 */
public Class classForSchemaName(String schemaName, GenerationContext context) {
  ClassDescriptor descriptor = context.getSession().getDescriptorForAlias(schemaName);
  if (descriptor == null) {
    throw JPQLException.entityTypeNotFound(getQueryInfo(), schemaName);
  }
  Class theClass = descriptor.getJavaClass();
  if (theClass == null) {
    throw JPQLException.resolutionClassNotFoundException(getQueryInfo(), schemaName);
  }
  return theClass;
}
origin: com.haulmont.thirdparty/eclipselink

/**
 * INTERNAL
 * Generate an exception which encapsulates all the exceptions generated
 * by this parser. Special case where the first exception is an
 * JPQLException. 
 */
protected JPQLException generateException() {
  //Handle exceptions we expect (such as expressionSotSupported)
  Exception firstException = (Exception)getErrors().get(0);
  if (firstException instanceof JPQLException) {
    return (JPQLException)firstException;
  }
  //Handle general exceptions, such as NPE
  JPQLException exception = 
    JPQLException.generalParsingException(getQueryInfo());
  exception.setInternalExceptions(getErrors());
  return exception;
}
origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

  /**
   * resolveClass: Answer the class which corresponds to my variableName. This is the class for
   * an alias, where the variableName is registered to an alias.
   */
  public Class resolveClass(GenerationContext context) {
    String alias = abstractSchemaName;
    ClassDescriptor descriptor = context.getSession().getDescriptorForAlias(alias);
    if (descriptor == null) {
      throw JPQLException.entityTypeNotFound2(
        context.getParseTreeContext().getQueryInfo(), 
        getLine(), getColumn(), alias);
    }
    Class theClass = descriptor.getJavaClass();
    if (theClass == null) {
      throw JPQLException.resolutionClassNotFoundException2(
        context.getParseTreeContext().getQueryInfo(), 
        getLine(), getColumn(), alias);
    }
    return theClass;
  }
}
org.eclipse.persistence.exceptionsJPQLException

Javadoc

Purpose: EJBQL parsing and resolution problems will raise this exception

Most used methods

  • <init>
    INTERNAL Only TopLink can throw and create these excpetions
  • aliasResolutionException
  • constructorClassNotFound
  • entityTypeNotFound
    JPQLException Entity Type Not Found Indicates that a type specified in a JPQL query string cannot b
  • entityTypeNotFound2
  • expectedOrderableOrderByItem
  • generalParsingException
    INTERNAL Create an exception to wrap a general parsing exception
  • getInternalExceptions
    INTERNAL Return the collection of internal Exceptions. Intialize if there are no exceptions
  • hasInternalExceptions
    INTERNAL Does this exception have any internal errors?
  • indexOnlyAllowedOnVariable
  • invalidCollectionMemberDecl
  • invalidCollectionNavigation
  • invalidCollectionMemberDecl,
  • invalidCollectionNavigation,
  • invalidEnumEqualExpression,
  • invalidEnumLiteral,
  • invalidExpressionArgument,
  • invalidFunctionArgument,
  • invalidMultipleUseOfSameParameter,
  • invalidNavigation,
  • invalidSetClauseNavigation,
  • invalidSetClauseTarget

Popular in Java

  • Making http post requests using okhttp
  • getResourceAsStream (ClassLoader)
  • getSupportFragmentManager (FragmentActivity)
  • requestLocationUpdates (LocationManager)
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • Top 12 Jupyter Notebook Extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now