Klasse SqlType
java.lang.Object
org.apache.torque.templates.typemapping.SqlType
- Bekannte direkte Unterklassen:
SizedForBitDataSqlType
The SQL type data for a column. Can contain additional information such as
default size, scale and defaultValue.
This class is immutable.
- Version:
- $Id: SqlType.java 1917240 2024-04-21 13:22:54Z tv $
-
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungCreates a new SqlType with the given SQL Type.Creates a new SqlType with null scale and null default value.Creates a new SqlType with null default value.Creates a new SqlType.Creates a new SqlType by copying another sql type. -
Methodenübersicht
-
Konstruktordetails
-
SqlType
Creates a new SqlType with the given SQL Type. Size, scale and defaultValue are set to null.- Parameter:
sqlTypeName
- the SQL name of the SQL type, or null.
-
SqlType
Creates a new SqlType with null scale and null default value.- Parameter:
sqlTypeName
- the SQL name of the SQL type, not null.size
- the default size of the columns with this SQL type. Can be overridden in the column definition.- Löst aus:
NullPointerException
- if sqlTypeName is null.
-
SqlType
Creates a new SqlType with null default value.- Parameter:
sqlTypeName
- the SQL name of the SQL type, not null.size
- the default size of the columns with this SQL type. Can be overridden in the column definition.scale
- the default scale of the columns with this SQL type. Can be overridden in the column definition.- Löst aus:
NullPointerException
- if sqlTypeName is null.
-
SqlType
Creates a new SqlType.- Parameter:
sqlTypeName
- the SQL name of the SQL type, not null.size
- the default size of the columns with this SQL type. Can be overridden in the column definition.scale
- the default scale of the columns with this SQL type. Can be overridden in the column definition.defaultValue
- the default "default value" of the columns with this SQL type. Can be overridden in the column definition.- Löst aus:
NullPointerException
- if sqlTypeName is null.
-
SqlType
Creates a new SqlType by copying another sql type.- Parameter:
sqlType
- the SQL type, to copy, not null.size
- the default size of the columns with this SQL type.scale
- the default scale of the columns with this SQL type.defaultValue
- the default "default value" of the columns with this SQL type.- Löst aus:
NullPointerException
- if sqlType is null.
-
-
Methodendetails
-
getScale
- Gibt zurück:
- Returns the scale.
-
getSize
- Gibt zurück:
- Returns the size.
-
getDefaultValue
- Gibt zurück:
- Returns the defaultValue.
-
getSqlTypeName
Returns the SQL type name.- Gibt zurück:
- The SQL type name for this column type, or null if the type is not set.
-
printSize
Return the size and scale in brackets for use in an SQL script.- Gibt zurück:
- size and scale, size or an empty String if there are no values available.
-
printScale
Return the scale in brackets for use in an SQL script.- Gibt zurück:
- scale or an empty String if there are no values available.
-
getNew
Returns a new instance with the given sqlTypeName, size, scale and default value.- Parameter:
size
- of the sqlscale
- of the sqldefaultValue
- to be provided- Gibt zurück:
- a new instance with the given parameters.
-