Klasse SchemaTypeHelper
java.lang.Object
org.apache.torque.templates.transformer.SchemaTypeHelper
Helper class for retrieving the schema type of a column.
$Id: SchemaTypeHelper.java 1856067 2019-03-22 15:32:47Z gk $
-
Methodenübersicht
Modifizierer und TypMethodeBeschreibungstatic SqlType
getDomain
(SourceElement columnElement, ControllerState controllerState) static SqlType
getDomain
(Column column, ControllerState controllerState) static SchemaType
getSchemaType
(SourceElement columnElement, ControllerState controllerState) Determines the schema type of a column.static SchemaType
getSchemaType
(Column column, ControllerState controllerState) Determines the schema type of a column.static SqlType
getSqlType
(SchemaType schemaType, SqlType domainType, ControllerState controllerState, String size, String scale, String defaultValue) Returns the SQL type for a schema type and the specified target database.
-
Methodendetails
-
getSchemaType
public static SchemaType getSchemaType(SourceElement columnElement, ControllerState controllerState) throws SourceTransformerException Determines the schema type of a column.- Parameter:
columnElement
- the source element which defines the column for which the schema type should be determined; not null.controllerState
- the controller state, not null.- Gibt zurück:
- the schema type of the column, not null.
- Löst aus:
SourceTransformerException
- if the name attribute is not set in the column or if the type refers to an unknown type.
-
getSchemaType
public static SchemaType getSchemaType(Column column, ControllerState controllerState) throws SourceTransformerException Determines the schema type of a column.- Parameter:
column
- the column for which the schema type should be determined; not null.controllerState
- the controller state, not null.- Gibt zurück:
- the schema type of the column, not null.
- Löst aus:
SourceTransformerException
- if the name attribute is not set in the column or if the type refers to an unknown type.
-
getSqlType
public static SqlType getSqlType(SchemaType schemaType, SqlType domainType, ControllerState controllerState, String size, String scale, String defaultValue) Returns the SQL type for a schema type and the specified target database.- Parameter:
schemaType
- the schema type for which the SQL type should be determined, not null.domainType
- the domain type which overrides the schema type, or null if no domain is defined.controllerState
- the controller state, not null.size
- overrides the size from schemaType and/or domainType, or null to use the default from domainType or schemaType.scale
- overrides the scale from schemaType and/or domainType, or null to use the default from domainType or schemaType.defaultValue
- overrides the defaultValue from schemaType and/or domainType, or null to use the default from domainType or schemaType.- Gibt zurück:
- the the SQL type for the schema type, or null if no SQL type exists for the schema type.
-
getDomain
public static SqlType getDomain(SourceElement columnElement, ControllerState controllerState) throws SourceTransformerException - Löst aus:
SourceTransformerException
-
getDomain
public static SqlType getDomain(Column column, ControllerState controllerState) throws SourceTransformerException - Löst aus:
SourceTransformerException
-