org.codehaus.modello.generator.database.type
public class Types extends Object
Version: 1.1 2003/02/05 08:08:37
Constructor Summary | |
---|---|
Types()
Construct a new empty Types |
Method Summary | |
---|---|
void | addAutoIncrementMapping(Mapping mapping)
Add an auto-increment mapping. |
void | addMapping(Mapping mapping)
Add a mapping. |
void | addType(Type type)
Add a type. |
TypeMapping | getAutoIncrementMapping(String name, long size)
Returns the closest auto-increment type mapping matching the requested
type name and size
|
List | getAutoIncrementMappings()
Returns all auto-increment mappings |
List | getMappings()
Returns all mappings that the database supports |
String | getSQLType(Column column)
Helper to return the SQL type for a column
|
Type | getType(String sqlName)
Returns a type, based on its name
|
TypeMapping | getTypeMapping(String name, long size)
Returns the first type matching the requested type name and size
|
protected TypeMapping | getTypeMapping(List mappings, long size)
Returns the closest type mapping for a requested size, from a list
of Mapping s.
|
List | getTypes()
Returns all types |
TypeMapping | promote(String name, long size)
Promote a type to that supported by the database provider.
|
TypeMapping | promote(String fromName, String toName, long size)
Promote a type to another type
|
protected TypeMapping | promote(String name, long size, String[] types)
Promote a type to that supported by the database provider.
|
protected TypeMapping | promote(String name, long size, String[] types, String defaultName)
Promote a type to that supported by the database provider.
|
Types
Throws: IllegalArgumentException if no there is no corresponding {@link Type} registered for {@link Mapping#getSQLName}
Throws: IllegalArgumentException if no there is no corresponding {@link Type} registered for {@link Mapping#getSQLName}
Parameters: name the JDBC type name size the requested size. A size <= 0 indicates that the type has no size
Returns: the closest matching mapping, or null
if none
exists
Parameters: column the column
Returns: the SQL type of column
Parameters: sqlName the name of the type
Returns: the type corresponding to sqlName
, or
null
if no such type exists
Parameters: name the JDBC type name size the requested size. A size of 0 indicates that the type has no size
Returns: the closest matching type, or null
if none exists
Mapping
s.
Note that the returned mapping may specify a size less than that
requested.
Parameters: mappings a list of Mappings
size the requested size
Returns: the closest type mapping
Parameters: name the JDBC type name size the requested size
Returns: the promoted type mapping, or null
if the type
can't be promoted
Parameters: fromName the JDBC type name to promote toName the JDBC type name to promote to size the requested size
Returns: the promoted type mapping, or null
if the
promotion is invalid, or isn't supported by the database provider
Parameters: name the JDBC type name size the requested size types the set of JDBC types that name
may be
promoted to
Returns: the promoted type mapping, or null
if the type
can't be promoted
Parameters: name the JDBC type name size the requested size types the set of JDBC types that name
may be
promoted to defaultName the default type name to promote to. If non-null,
this is used in preference to those listed by types
Returns: the promoted type mapping, or null
if the type
can't be promoted