パッケージ org.nkjmlab.sorm4j.config

クラス DefaultSqlToJavaDataConverter

    • フィールドの詳細

    • コンストラクタの詳細

      • DefaultSqlToJavaDataConverter

        public DefaultSqlToJavaDataConverter()
    • メソッドの詳細

      • main

        public static void main​(String[] args)
      • getValueByClass

        public Object getValueByClass​(ResultSet resultSet,
                                      int column,
                                      Class<?> type)
                               throws SQLException
        インタフェースからコピーされた説明: SqlToJavaDataConverter
        Reads a column from the current row in the provided ResultSet and returns an instance of the specified Java Class containing the values read. This method is mainly used for "SEARCH SQL AND READ TO POJO". i.e. Convert from Sql to Java by the specified class. This method is used while converting ResultSet rows to objects. The class type is the field type in the target bean. null's will be respected for any non-native types. This means that if a field is of type Integer it will be able to receive a null value from the ResultSet; on the other hand, if a field is of type int it will receive 0 for a null value from the ResultSet.
        定義:
        getValueByClass インタフェース内 SqlToJavaDataConverter
        パラメータ:
        resultSet - ResultSet (positioned in the row to be processed)
        column - column index in the result set (starting with 1)
        type - Class of the object to be returned
        例外:
        SQLException
      • getValueBySqlType

        public Object getValueBySqlType​(ResultSet resultSet,
                                        int column,
                                        int type)
                                 throws SQLException
        インタフェースからコピーされた説明: SqlToJavaDataConverter
        Reads a column from the current row in the provided ResultSet and return a value correspondent to the SQL type provided (as defined in java.sql.Types). null's are respected for all types. This means that if a column is of type LONG and its value comes from the database as null, this method will return null for it. This method is used for "SEARCH AND READ TO MAP". i.e. Convert from Sql to Java by the specified Sql.Types.
        定義:
        getValueBySqlType インタフェース内 SqlToJavaDataConverter
        パラメータ:
        resultSet - ResultSet (positioned in the row to be processed)
        column - Column index in the result set (starting with 1)
        type - type of the column (as defined in java.sql.Types)
        例外:
        SQLException
      • sqlTypeToString

        public static String sqlTypeToString​(int type)