org.jooq.impl
Class FieldTypeHelper

java.lang.Object
  extended by org.jooq.impl.FieldTypeHelper

public final class FieldTypeHelper
extends Object

Utility methods related to the treatment of fields and their types

This class is for JOOQ INTERNAL USE only. Do not reference directly

Author:
Lukas Eder

Method Summary
static Class<?> getClass(int sqlType, int precision, int scale)
           
static
<T> DataType<T>
getDataType(SQLDialect dialect, Class<? extends T> type)
           
static DataType<?> getDialectDataType(SQLDialect dialect, String t, int p, int s)
          Convert a type name (using precision and scale) into a Java class
static Class<?> getDialectJavaType(SQLDialect dialect, String t, int p, int s)
          Convert a type name (using precision and scale) into a Java class
static
<T> T
getFromSQLInput(Configuration configuration, SQLInput stream, Field<T> field)
           
static
<T> T
getFromStatement(ExecuteContext ctx, Class<? extends T> type, int index)
           
static Map<String,Class<?>> getTypeMapping(Class<?> udtType)
           
static String normalise(String typeName)
           
static
<T> void
writeToSQLOutput(SQLOutput stream, Class<? extends T> type, T value)
           
static
<T> void
writeToSQLOutput(SQLOutput stream, Field<T> field, T value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getFromSQLInput

public static <T> T getFromSQLInput(Configuration configuration,
                                    SQLInput stream,
                                    Field<T> field)
                         throws SQLException
Throws:
SQLException

writeToSQLOutput

public static <T> void writeToSQLOutput(SQLOutput stream,
                                        Field<T> field,
                                        T value)
                             throws SQLException
Throws:
SQLException

writeToSQLOutput

public static <T> void writeToSQLOutput(SQLOutput stream,
                                        Class<? extends T> type,
                                        T value)
                             throws SQLException
Throws:
SQLException

getTypeMapping

public static Map<String,Class<?>> getTypeMapping(Class<?> udtType)
                                           throws SQLException
Throws:
SQLException

getFromStatement

public static <T> T getFromStatement(ExecuteContext ctx,
                                     Class<? extends T> type,
                                     int index)
                          throws SQLException
Throws:
SQLException

getClass

public static Class<?> getClass(int sqlType,
                                int precision,
                                int scale)

getDataType

public static <T> DataType<T> getDataType(SQLDialect dialect,
                                          Class<? extends T> type)

normalise

public static String normalise(String typeName)
Returns:
The type name without all special characters and white spaces

getDialectDataType

public static DataType<?> getDialectDataType(SQLDialect dialect,
                                             String t,
                                             int p,
                                             int s)
                                      throws SQLDialectNotSupportedException
Convert a type name (using precision and scale) into a Java class

Throws:
SQLDialectNotSupportedException

getDialectJavaType

public static Class<?> getDialectJavaType(SQLDialect dialect,
                                          String t,
                                          int p,
                                          int s)
                                   throws SQLDialectNotSupportedException
Convert a type name (using precision and scale) into a Java class

Throws:
SQLDialectNotSupportedException


Copyright © 2012. All Rights Reserved.