org.jboss.ejb.plugins.cmp.jdbc.metadata
Class JDBCMappingMetaData

java.lang.Object
  extended byorg.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCMappingMetaData

public final class JDBCMappingMetaData
extends java.lang.Object

Imutable class which holds a mapping between a Java Class and a JDBC type and a SQL type.


Constructor Summary
JDBCMappingMetaData(org.w3c.dom.Element element)
          Constructs a mapping with the data contained in the mapping xml element from a jbosscmp-jdbc xml file.
 
Method Summary
 java.lang.String getJavaType()
          Gets the java type of this mapping.
 int getJdbcType()
          Gets the jdbc type of this mapping.
static int getJdbcTypeFromName(java.lang.String name)
          Gets the JDBC type constant int for the name.
 java.lang.String getParamSetter()
           
 java.lang.String getResultReader()
           
 java.lang.String getSqlType()
          Gets the sql type of this mapping.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JDBCMappingMetaData

public JDBCMappingMetaData(org.w3c.dom.Element element)
                    throws DeploymentException (src) 
Constructs a mapping with the data contained in the mapping xml element from a jbosscmp-jdbc xml file.

Parameters:
element - the xml Element which contains the metadata about this mapping
Throws:
DeploymentException (src) - if the xml element is not semantically correct
Method Detail

getJdbcTypeFromName

public static int getJdbcTypeFromName(java.lang.String name)
                               throws DeploymentException (src) 
Gets the JDBC type constant int for the name. The mapping from name to jdbc type is contained in java.sql.Types.

Parameters:
name - the name for the jdbc type
Returns:
the int type constant from java.sql.Types
Throws:
DeploymentException (src)
See Also:
Types

getJavaType

public java.lang.String getJavaType()
Gets the java type of this mapping. The java type is used to differentiate this mapping from other mappings.

Returns:
the java type of this mapping

getJdbcType

public int getJdbcType()
Gets the jdbc type of this mapping. The jdbc type is used to retrieve data from a result set and to set parameters in a prepared statement.

Returns:
the jdbc type of this mapping

getSqlType

public java.lang.String getSqlType()
Gets the sql type of this mapping. The sql type is the sql column data type, and is used in CREATE TABLE statements.

Returns:
the sql type String of this mapping

getParamSetter

public java.lang.String getParamSetter()

getResultReader

public java.lang.String getResultReader()