net.sf.farrago.type
Interface FarragoTypeFactory

All Superinterfaces:
OJTypeFactory, RelDataTypeFactory
All Known Implementing Classes:
FarragoTypeFactoryImpl, LucidDbTypeFactory

public interface FarragoTypeFactory
extends OJTypeFactory

FarragoTypeFactory is a Farrago-specific refinement of the RelDataTypeFactory interface.

Version:
$Id: //open/dev/farrago/src/net/sf/farrago/type/FarragoTypeFactory.java#19 $
Author:
John V. Sichi

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.eigenbase.reltype.RelDataTypeFactory
RelDataTypeFactory.FieldInfo, RelDataTypeFactory.ListFieldInfo
 
Method Summary
 RelDataType createCwmElementType(FemAbstractTypedElement element)
          Creates a type which represents the datatype of a FemAbstractTypedElement.
 RelDataType createCwmType(CwmSqldataType cwmType)
          Creates a type which represents a CwmSqldataType.
 RelDataType createJdbcColumnType(ResultSet getColumnsResultSet, boolean substitute)
          Creates a type which represents column metadata returned by the DatabaseMetaData.getColumns(java.lang.String, java.lang.String, java.lang.String, java.lang.String) call.
 RelDataType createJdbcColumnType(ResultSet getColumnsResultSet, boolean substitute, Properties typeMapping)
          Creates a type which represents column metadata returned by the DatabaseMetaData.getColumns(java.lang.String, java.lang.String, java.lang.String, java.lang.String) call.
 RelDataType createMofType(StructuralFeature feature)
          Creates a type which represents a MOF feature.
 RelDataType createResultSetType(ResultSetMetaData metaData, boolean substitute)
          Creates a type which represents the row datatype of a JDBC ResultSet.
 RelDataType createResultSetType(ResultSetMetaData metaData, boolean substitute, Properties typeMapping)
          Creates a type which represents the row datatype of a JDBC ResultSet.
 RelDataType createStructTypeFromClassifier(CwmClassifier classifier)
          Creates a type which represents a structured row based on a classifier definition from the catalog.
 Class getClassForJavaParamStyle(RelDataType type)
          Looks up the Class specified by the JAVA parameter style for user-defined routines.
 Class getClassForPrimitive(RelDataType type)
          Looks up the Class representing a primitive used to hold a value of the given type.
 FarragoRepos getRepos()
           
 Expression getValueAccessExpression(RelDataType type, Expression expr)
          Constructs an OpenJava expression to access a value of an atomic type.
 
Methods inherited from interface org.eigenbase.oj.OJTypeFactory
toOJClass, toType
 
Methods inherited from interface org.eigenbase.reltype.RelDataTypeFactory
copyType, createArrayType, createDecimalProduct, createDecimalQuotient, createJavaType, createJoinType, createMultisetType, createSqlIntervalType, createSqlType, createSqlType, createSqlType, createStructType, createStructType, createStructType, createTypeWithCharsetAndCollation, createTypeWithNullability, getDefaultCharset, leastRestrictive, useDoubleMultiplication
 

Method Detail

getRepos

FarragoRepos getRepos()
Returns:
associated FarragoRepos

createCwmElementType

RelDataType createCwmElementType(FemAbstractTypedElement element)
Creates a type which represents the datatype of a FemAbstractTypedElement.

Parameters:
element - CWM typed element
Returns:
generated type

createCwmType

RelDataType createCwmType(CwmSqldataType cwmType)
Creates a type which represents a CwmSqldataType.

Parameters:
cwmType - CWM type instance
Returns:
generated type

createStructTypeFromClassifier

RelDataType createStructTypeFromClassifier(CwmClassifier classifier)
Creates a type which represents a structured row based on a classifier definition from the catalog.

Parameters:
classifier - definition of classifier
Returns:
generated type, or null if classifier had no features

createResultSetType

RelDataType createResultSetType(ResultSetMetaData metaData,
                                boolean substitute)
Creates a type which represents the row datatype of a JDBC ResultSet. Optionally, unsupported types can be replaced with substitutes. In the worst case, the substitute is VARCHAR(1024). Less drastic examples are ignoring datetime fractional seconds precision or capping numeric precision at our maximum.

Parameters:
metaData - metadata for JDBC ResultSet
substitute - if true, use substitutions; if false, throw exception for unsupported types or type attributes
Returns:
generated type

createResultSetType

RelDataType createResultSetType(ResultSetMetaData metaData,
                                boolean substitute,
                                Properties typeMapping)
Creates a type which represents the row datatype of a JDBC ResultSet. Optionally, unsupported types can be replaced with substitutes. In the worst case, the substitute is VARCHAR(1024). Less drastic examples are ignoring datetime fractional seconds precision or capping numeric precision at our maximum.

Parameters:
metaData - metadata for JDBC ResultSet
substitute - if true, use substitutions; if false, throw exception for unsupported types or type attributes
typeMapping - types to substitute
Returns:
generated type

createJdbcColumnType

RelDataType createJdbcColumnType(ResultSet getColumnsResultSet,
                                 boolean substitute)
Creates a type which represents column metadata returned by the DatabaseMetaData.getColumns(java.lang.String, java.lang.String, java.lang.String, java.lang.String) call. See createResultSetType(java.sql.ResultSetMetaData, boolean) for details on type substitutions.

Parameters:
getColumnsResultSet - ResultSet positioned on a row returned from the getColumns call; result set position is unchanged by this method
substitute - if true, use substitutions; if false, throw exception for unsupported types or type attributes
Returns:
generated type

createJdbcColumnType

RelDataType createJdbcColumnType(ResultSet getColumnsResultSet,
                                 boolean substitute,
                                 Properties typeMapping)
Creates a type which represents column metadata returned by the DatabaseMetaData.getColumns(java.lang.String, java.lang.String, java.lang.String, java.lang.String) call. See createResultSetType(java.sql.ResultSetMetaData, boolean) for details on type substitutions.

Parameters:
getColumnsResultSet - ResultSet positioned on a row returned from the getColumns call; result set position is unchanged by this method
substitute - if true, use substitutions; if false, throw exception for unsupported types or type attributes
typeMapping - types to substitute
Returns:
generated type

createMofType

RelDataType createMofType(StructuralFeature feature)
Creates a type which represents a MOF feature.

Parameters:
feature - MOF feature
Returns:
generated type

getValueAccessExpression

Expression getValueAccessExpression(RelDataType type,
                                    Expression expr)
Constructs an OpenJava expression to access a value of an atomic type.

Parameters:
type - atomic type
expr - expression representing site to be accessed
Returns:
expression for accessing value

getClassForPrimitive

Class getClassForPrimitive(RelDataType type)
Looks up the Class representing a primitive used to hold a value of the given type.

Parameters:
type - value type
Returns:
primitive Class, or null if a non-primitive Object is used at runtime to represent values of the given type

getClassForJavaParamStyle

Class getClassForJavaParamStyle(RelDataType type)
Looks up the Class specified by the JAVA parameter style for user-defined routines.

Parameters:
type - SQL type
Returns:
corresponding Java class, or null if no mapping is defined