|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.exolab.castor.jdo.engine.SQLTypes
public final class SQLTypes
Nested Class Summary | |
---|---|
static class |
SQLTypes.SQLTypeConvertor
|
(package private) static class |
SQLTypes.TypeConvertorInfo
Information used to locate a type convertor. |
(package private) static class |
SQLTypes.TypeInfo
|
Field Summary | |
---|---|
(package private) static SQLTypes.TypeConvertorInfo[] |
_typeConvertors
List of all the default convertors between Java types. |
(package private) static SQLTypes.TypeInfo[] |
_typeInfos
List of all the SQL types supported by Castor JDO. |
Constructor Summary | |
---|---|
SQLTypes()
|
Method Summary | |
---|---|
static TypeConvertor |
getConvertor(java.lang.Class fromType,
java.lang.Class toType)
Returns a type convertor. |
static java.lang.Object |
getObject(java.sql.ResultSet rs,
int index,
int sqlType)
|
static int |
getSQLType(java.lang.Class javaType)
Returns the SQL type from the specified Java type. |
static java.lang.String |
javaToSqlName(java.lang.String javaName)
Convert from Java name to SQL name. |
static java.lang.String |
paramFromName(java.lang.String sqlTypeName)
Extracts parameter for type convertor from the name of the SQL type of the form "SQL_type.domain". |
static void |
setObject(java.sql.PreparedStatement stmt,
int index,
java.lang.Object value,
int sqlType)
|
static java.lang.String |
sqlToJavaName(java.lang.String sqlName,
boolean className,
java.lang.String scope)
Convert from SQL name to Java name. |
static int |
sqlTypeFromName(java.lang.String sqlTypeName)
Returns the Java type from the SQL type name. |
static java.lang.Class |
typeFromName(java.lang.String sqlTypeName)
Returns the Java type from the SQL type name. |
static java.lang.Class |
typeFromSQLType(int sqlType)
Returns the Java type from the SQL type. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
static SQLTypes.TypeInfo[] _typeInfos
static SQLTypes.TypeConvertorInfo[] _typeConvertors
Constructor Detail |
---|
public SQLTypes()
Method Detail |
---|
public static java.lang.Class typeFromName(java.lang.String sqlTypeName) throws MappingException
sqlTypeName
- SQL type name (e.g. numeric)
MappingException
- The SQL type is not recognized.public static int sqlTypeFromName(java.lang.String sqlTypeName) throws MappingException
sqlTypeName
- SQL type name (e.g. numeric)
MappingException
- The SQL type is not recognized.public static java.lang.String paramFromName(java.lang.String sqlTypeName)
sqlTypeName
- SQL type name (e.g. char[01])
public static java.lang.Class typeFromSQLType(int sqlType) throws MappingException
sqlType
- SQL type name (see JDBC API)
MappingException
- The SQL type is not recognized.public static int getSQLType(java.lang.Class javaType)
typeFromSQLType(int)
or typeFromName(java.lang.String)
.
javaType
- The Java class of the SQL type
public static java.lang.String javaToSqlName(java.lang.String javaName)
For example:
javaName
- The Java identifier name
public static java.lang.String sqlToJavaName(java.lang.String sqlName, boolean className, java.lang.String scope)
For example:
sqlName
- The SQL identifier nameclassName
- True if class name (first letter must be upper case)scope
- Optional scope preceding name (package name, compound field)
public static java.lang.Object getObject(java.sql.ResultSet rs, int index, int sqlType) throws java.sql.SQLException
java.sql.SQLException
public static void setObject(java.sql.PreparedStatement stmt, int index, java.lang.Object value, int sqlType) throws java.sql.SQLException
java.sql.SQLException
public static TypeConvertor getConvertor(java.lang.Class fromType, java.lang.Class toType) throws MappingException
fromType
- The Java type to convert fromtoType
- The Java type to convert to
MappingException
- No suitable convertor was found
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |