org.exolab.castor.jdo.oql
Class ParamInfo

java.lang.Object
  extended by org.exolab.castor.jdo.oql.ParamInfo

public class ParamInfo
extends java.lang.Object

A class to store and check information about numbered query parameters.

Version:
$Revision: 1.4 $ $Date: 2004/11/28 13:53:47 $
Author:
Nissim Karpenstein

Constructor Summary
ParamInfo(java.lang.String userDefinedType, java.lang.String systemType, JDOFieldDescriptor desc, java.lang.ClassLoader classLoader)
          Creates a new ParamInfo.
 
Method Summary
 void check(java.lang.String userDefinedType, java.lang.String systemType)
          Checks whether the userDefinedType and systemType match those previousle specified in the constructor.
 TypeConvertor getConvertor()
           
 java.lang.String getConvertorParam()
          Returns the convertor parameter.
 java.lang.Class getFieldType()
          Returns the Java field type
 java.lang.Class getSQLType()
          Returns the SQL type
 java.lang.Class getTheClass()
          Accessor method for _class.
 boolean isUserDefined()
          Specifies whether this parameter was specified in the OQL with a User defined type, like $(int)1.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParamInfo

public ParamInfo(java.lang.String userDefinedType,
                 java.lang.String systemType,
                 JDOFieldDescriptor desc,
                 java.lang.ClassLoader classLoader)
          throws QueryException
Creates a new ParamInfo. Which checks for incompatibilities between types.

Parameters:
userDefinedType - The user defined type, empty string if undefined.
systemType - The system generated type
desc - JDO field descriptor.
classLoader - ClassLoader instance, null if not specified.
Throws:
QueryException - if the user defined type cannot be converted to the systemType or if the type is not found.
Method Detail

check

public void check(java.lang.String userDefinedType,
                  java.lang.String systemType)
           throws QueryException
Checks whether the userDefinedType and systemType match those previousle specified in the constructor.

Parameters:
userDefinedType - The user defined type, empty string if undefined.
systemType - The system generated type
Throws:
QueryException - if the user defined type is not the same as the one prevuiously specified in the constructor, or if the systemType is not convertable to the original systemType.

isUserDefined

public boolean isUserDefined()
Specifies whether this parameter was specified in the OQL with a User defined type, like $(int)1.

Returns:
True if this parameter whas a user defined type otherwise false

getTheClass

public java.lang.Class getTheClass()
Accessor method for _class.

Returns:
private member _class

getFieldType

public java.lang.Class getFieldType()
Returns the Java field type

Returns:
Java field type

getSQLType

public java.lang.Class getSQLType()
Returns the SQL type

Returns:
SQL type

getConvertor

public TypeConvertor getConvertor()
Returns:
Convertor that converts from the parameter type to SQL type of the parameter, if the latter is defined and not equal to the parameter class, otherwise returns null.

getConvertorParam

public java.lang.String getConvertorParam()
Returns the convertor parameter.

Returns:
Convertor parameter


Intalio Inc. (C) 1999-2004. All rights reserved http://www.intalio.com