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

java.lang.Object
  extended by org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCTypeMappingMetaData

public final class JDBCTypeMappingMetaData
extends Object

Imutable class which holds a map between Java Classes and JDBCMappingMetaData.

Version:
$Revision: 57209 $
Author:
Dain Sundstrom, Sebastien Alborini, Alex Loubyansky

Field Summary
static String ABS
           
static JDBCFunctionMappingMetaData AVG_FUNC
           
static String CONCAT
           
static String COUNT
           
static JDBCFunctionMappingMetaData COUNT_FUNC
           
static String LCASE
           
static String LENGTH
           
static String LOCATE
           
static JDBCFunctionMappingMetaData MAX_FUNC
           
static JDBCFunctionMappingMetaData MIN_FUNC
           
static JDBCFunctionMappingMetaData MOD_FUNC
           
static String SQRT
           
static String SUBSTRING
           
static JDBCFunctionMappingMetaData SUM_FUNC
           
static String UCASE
           
 
Constructor Summary
JDBCTypeMappingMetaData(Element element)
          Constructs a mapping with the data contained in the type-mapping xml element from a jbosscmp-jdbc xml file.
 
Method Summary
 JDBCFunctionMappingMetaData getAddColumnTemplate()
          Returns add column SQL template.
 String getAliasHeaderPrefix()
          Gets the prefix for that is used when generating an alias header.
 String getAliasHeaderSuffix()
          Gets the suffix for that is used when generating an alias header.
 int getAliasMaxLength()
          Gets maximum length of a table alias.
 JDBCFunctionMappingMetaData getAlterColumnTemplate()
          Returns auto increment SQL template.
 JDBCFunctionMappingMetaData getAutoIncrementTemplate()
          Returns auto increment SQL template.
 JDBCFunctionMappingMetaData getDropColumnTemplate()
          Returns auto increment SQL template.
 String getFalseMapping()
          Gets the value to which the boolean false value in EJB-QL will be mapped.
 JDBCFunctionMappingMetaData getFkConstraintTemplate()
          Returns fk constraint SQL template.
 JDBCFunctionMappingMetaData getFunctionMapping(String name)
           
 Collection getMappings()
           
 int getMaxKeysInDelete()
           
 String getName()
          Gets the name of this mapping.
 JDBCFunctionMappingMetaData getPkConstraintTemplate()
          Returns pk constraint SQL template.
 JDBCFunctionMappingMetaData getRowLockingTemplate()
          Returns rowLocking SQL template.
 String getTrueMapping()
          Gets the value to which the boolean true value in EJB-QL will be mapped.
 JDBCMappingMetaData getTypeMappingMetaData(Class type)
           
 boolean isSubquerySupported()
          Does this type mapping support subqueries?
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONCAT

public static final String CONCAT
See Also:
Constant Field Values

SUBSTRING

public static final String SUBSTRING
See Also:
Constant Field Values

LCASE

public static final String LCASE
See Also:
Constant Field Values

UCASE

public static final String UCASE
See Also:
Constant Field Values

LENGTH

public static final String LENGTH
See Also:
Constant Field Values

LOCATE

public static final String LOCATE
See Also:
Constant Field Values

ABS

public static final String ABS
See Also:
Constant Field Values

SQRT

public static final String SQRT
See Also:
Constant Field Values

COUNT

public static final String COUNT
See Also:
Constant Field Values

COUNT_FUNC

public static JDBCFunctionMappingMetaData COUNT_FUNC

MAX_FUNC

public static JDBCFunctionMappingMetaData MAX_FUNC

MIN_FUNC

public static JDBCFunctionMappingMetaData MIN_FUNC

AVG_FUNC

public static JDBCFunctionMappingMetaData AVG_FUNC

SUM_FUNC

public static JDBCFunctionMappingMetaData SUM_FUNC

MOD_FUNC

public static JDBCFunctionMappingMetaData MOD_FUNC
Constructor Detail

JDBCTypeMappingMetaData

public JDBCTypeMappingMetaData(Element element)
                        throws org.jboss.deployment.DeploymentException
Constructs a mapping with the data contained in the type-mapping xml element from a jbosscmp-jdbc xml file.

Parameters:
element - the xml Element which contains the metadata about this type mapping
Throws:
org.jboss.deployment.DeploymentException - if the xml element is not semantically correct
Method Detail

getName

public String getName()
Gets the name of this mapping. The mapping name used to differentiate this mapping from other mappings and the mapping the application used is retrieved by name.

Returns:
the name of this mapping.

getAliasHeaderPrefix

public String getAliasHeaderPrefix()
Gets the prefix for that is used when generating an alias header. An alias header is prepended to a generated table alias to prevent name collisions. An alias header is constructed as folows: aliasHeaderPrefix + int_counter + aliasHeaderSuffix

Returns:
the prefix for alias headers

getAliasHeaderSuffix

public String getAliasHeaderSuffix()
Gets the suffix for that is used when generating an alias header. An alias header is prepended to a generated table alias to prevent name collisions. An alias header is constructed as folows: aliasHeaderPrefix + int_counter + aliasHeaderSuffix

Returns:
the suffix for alias headers

getAliasMaxLength

public int getAliasMaxLength()
Gets maximum length of a table alias. An alias is constructed as folows: aliasHeader + ejb_ql_identifier_path

Returns:
the maximum length that a table alias can be

isSubquerySupported

public boolean isSubquerySupported()
Does this type mapping support subqueries?


getTrueMapping

public String getTrueMapping()
Gets the value to which the boolean true value in EJB-QL will be mapped.


getFalseMapping

public String getFalseMapping()
Gets the value to which the boolean false value in EJB-QL will be mapped.


getMaxKeysInDelete

public int getMaxKeysInDelete()

getTypeMappingMetaData

public JDBCMappingMetaData getTypeMappingMetaData(Class type)

getFunctionMapping

public JDBCFunctionMappingMetaData getFunctionMapping(String name)

getRowLockingTemplate

public JDBCFunctionMappingMetaData getRowLockingTemplate()
Returns rowLocking SQL template.


getPkConstraintTemplate

public JDBCFunctionMappingMetaData getPkConstraintTemplate()
Returns pk constraint SQL template.


getFkConstraintTemplate

public JDBCFunctionMappingMetaData getFkConstraintTemplate()
Returns fk constraint SQL template.


getAutoIncrementTemplate

public JDBCFunctionMappingMetaData getAutoIncrementTemplate()
Returns auto increment SQL template.


getAddColumnTemplate

public JDBCFunctionMappingMetaData getAddColumnTemplate()
Returns add column SQL template.


getDropColumnTemplate

public JDBCFunctionMappingMetaData getDropColumnTemplate()
Returns auto increment SQL template.


getAlterColumnTemplate

public JDBCFunctionMappingMetaData getAlterColumnTemplate()
Returns auto increment SQL template.


getMappings

public Collection getMappings()


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.