public class TypeNames extends Object
names.put(type, "TEXT" ); names.put(type, 255, "VARCHAR($l)" ); names.put(type, 65534, "LONGVARCHAR($l)" );will give you back the following:
names.get(type) // --> "TEXT" (default) names.get(type, 100) // --> "VARCHAR(100)" (100 is in [0:255]) names.get(type, 1000) // --> "LONGVARCHAR(1000)" (1000 is in [256:65534]) names.get(type, 100000) // --> "TEXT" (default)On the other hand, simply putting
names.put(type, "VARCHAR($l)" );would result in
names.get(type) // --> "VARCHAR($l)" (will cause trouble) names.get(type, 100) // --> "VARCHAR(100)" names.get(type, 10000) // --> "VARCHAR(10000)"
Constructor and Description |
---|
TypeNames() |
Modifier and Type | Method and Description |
---|---|
String |
get(int typecode)
get default type name for specified type
|
String |
get(int typeCode,
long size,
int precision,
int scale)
get type name for specified type and size
|
void |
put(int typecode,
long capacity,
String value)
set a type name for specified type key and capacity
|
void |
put(int typecode,
String value)
set a default type name for specified type key
|
public String get(int typecode) throws MappingException
typecode
- the type keyMappingException
public String get(int typeCode, long size, int precision, int scale) throws MappingException
typeCode
- the type keysize
- the SQL lengthscale
- the SQL scaleprecision
- the SQL precisionMappingException
public void put(int typecode, long capacity, String value)
typecode
- the type keypublic void put(int typecode, String value)
typecode
- the type keyCopyright © 2012 JBoss by Red Hat. All Rights Reserved.