java.lang.Object
com.sun.jdo.spi.persistence.support.ejb.ejbqlc.EJBQLC

public class EJBQLC extends Object
This class is the driver of the EJBQL compiler. It controls the compiler passes: syntax analysis, semantic analysis and generation of the JDOQL query.

A EJBQLC instance is able to compile multiple EJBQL queries as long as they come from the same deployement descriptor. The class uses the model instance passed to the constructor to access any meta data from the deployement descriptor. Method compile(java.lang.String, java.lang.reflect.Method, int, boolean, java.lang.String) compiles a single EJBQL query string together with the java.lang.reflect.Method instance of the corresponding finder/selector method. The result is a JDOQLElements instance, that can be used to construct a JDOQL query instance.

Author:
Michael Bouschen, Shing Wai Chan
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected EJBQLAST
    The intermediate form of the EJBQL query string.
    protected com.sun.jdo.api.persistence.model.Model
    Meta data access.
    protected static final ResourceBundle
    I18N support.
    protected NameMapper
    Name mapping EJB <-> JDO.
    static final String
    Signature with CVS keyword substitution for identifying the generated code
  • Constructor Summary

    Constructors
    Constructor
    Description
    EJBQLC(com.sun.jdo.api.persistence.model.Model model, NameMapper nameMapper)
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    compile(String ejbqlQuery, Method method, int resultTypeMapping, boolean finderNotSelector, String ejbName)
    Compiles the specified query string for the specified finder/selector method.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • model

      protected com.sun.jdo.api.persistence.model.Model model
      Meta data access.
    • nameMapper

      protected NameMapper nameMapper
      Name mapping EJB <-> JDO.
    • ast

      protected EJBQLAST ast
      The intermediate form of the EJBQL query string.
    • msgs

      protected static final ResourceBundle msgs
      I18N support.
    • SIGNATURE

      public static final String SIGNATURE
      Signature with CVS keyword substitution for identifying the generated code
      See Also:
  • Constructor Details

    • EJBQLC

      public EJBQLC(com.sun.jdo.api.persistence.model.Model model, NameMapper nameMapper)
      Constructor.
      Parameters:
      model - meta data access.
      nameMapper - name mapping EJB <-> JDO.
  • Method Details

    • compile

      public JDOQLElements compile(String ejbqlQuery, Method method, int resultTypeMapping, boolean finderNotSelector, String ejbName) throws EJBQLException
      Compiles the specified query string for the specified finder/selector method.
      Parameters:
      ejbqlQuery - the EJBQL query text
      method - the Method instance of the finder or selector
      resultTypeMapping - result-type-mapping element from the DD
      finderNotSelector - true indicates a finder, false a selector
      ejbName - the ejb name of the entity bean
      Throws:
      EJBQLException