com.sun.jdo.spi.persistence.support.ejb.ejbqlc
Class ParameterSupport

java.lang.Object
  extended by com.sun.jdo.spi.persistence.support.ejb.ejbqlc.ParameterSupport

public class ParameterSupport
extends Object

Helper class to handle EJBQL query parameters.

Author:
Michael Bouschen, Shing Wai Chan

Field Summary
protected static ResourceBundle msgs
          I18N support.
 
Constructor Summary
ParameterSupport(Method method)
          Constructor.
 
Method Summary
 int getParameterCount()
          Returns the number of parameters.
 String getParameterEjbName(int paramNumber)
          Get EJB name corresponding to the EJBQL parameter number.
 String getParameterEjbName(String ejbqlParamDecl)
          Get EJB name corresponding to the EJBQL parameter by input parameter declaration string.
 String[] getParameterEjbNames()
          Get all EJB names corresponding to the EJBQL parameters.
 String getParameterName(int paramNumber)
          Returns the name of the corresponding JDO parameter by parameter number.
 String getParameterName(String ejbqlParamDecl)
          Returns the name of the corresponding JDO parameter.
 Class getParameterType(int paramNumber)
          Returns the type of the EJBQL parameter by number.
 Class getParameterType(String ejbqlParamDecl)
          Returns type of the EJBQL parameter by input parameter declaration string.
 void setParameterEjbName(String ejbqlParamDecl, String ejbName)
          Set EJB name corresponding to the EJBQL parameter by input parameter declaration string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

msgs

protected static final ResourceBundle msgs
I18N support.

Constructor Detail

ParameterSupport

public ParameterSupport(Method method)
Constructor.

Parameters:
method - the Method instance of the finder/selector method.
Method Detail

getParameterType

public Class getParameterType(String ejbqlParamDecl)
Returns type of the EJBQL parameter by input parameter declaration string. The specified string denotes a parameter application in EJBQL. It has the form "?" where is the parameter number starting with 1.

Returns:
class instance representing the parameter type.

getParameterType

public Class getParameterType(int paramNumber)
Returns the type of the EJBQL parameter by number. Note, the numbering of EJBQL parameters starts with 1, so the method expects 1 as the number of the first parameter.

Returns:
class instance representing the parameter type.

getParameterEjbName

public String getParameterEjbName(String ejbqlParamDecl)
Get EJB name corresponding to the EJBQL parameter by input parameter declaration string.

Parameters:
ejbqlParamDecl - denotes a parameter application in EJBQL. It has the form "?" where is the parameter number starting with 1.
Returns:
class instance representing the parameter type.

getParameterEjbName

public String getParameterEjbName(int paramNumber)
Get EJB name corresponding to the EJBQL parameter number.

Parameters:
paramNumber - numbering of parameters starting with 1
Returns:
class instance representing the parameter type.

setParameterEjbName

public void setParameterEjbName(String ejbqlParamDecl,
                                String ejbName)
Set EJB name corresponding to the EJBQL parameter by input parameter declaration string.

Parameters:
ejbqlParamDecl - denotes a parameter application in EJBQL. It has the form "?" where is the parameter number starting with 1.
ejbName -

getParameterEjbNames

public String[] getParameterEjbNames()
Get all EJB names corresponding to the EJBQL parameters.

Returns:
class instance representing the parameter type.

getParameterName

public String getParameterName(String ejbqlParamDecl)
Returns the name of the corresponding JDO parameter. The specified string denotes a parameter application in EJBQL. It has the form "?" where is the parameter number starting with 1.

Returns:
name of JDOQL parameter

getParameterName

public String getParameterName(int paramNumber)
Returns the name of the corresponding JDO parameter by parameter number.

Returns:
name of JDOQL parameter

getParameterCount

public int getParameterCount()
Returns the number of parameters.

Returns:
parameter count.


Copyright © 2012. All Rights Reserved.