Class JDBCValueMappings.AbstractValueReaderWriter<JALO,​DB>

    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      JALO convertValueToJava​(DB value)  
      DB convertValueToSQL​(JALO value)  
      boolean getBoolean​(java.sql.ResultSet rs, int idx)  
      boolean getBoolean​(java.sql.ResultSet rs, java.lang.String fieldName)  
      byte getByte​(java.sql.ResultSet rs, int idx)  
      byte getByte​(java.sql.ResultSet rs, java.lang.String fieldName)  
      char getChar​(java.sql.ResultSet rs, int idx)  
      char getChar​(java.sql.ResultSet rs, java.lang.String fieldName)  
      double getDouble​(java.sql.ResultSet rs, int idx)  
      double getDouble​(java.sql.ResultSet rs, java.lang.String fieldName)  
      float getFloat​(java.sql.ResultSet rs, int idx)  
      float getFloat​(java.sql.ResultSet rs, java.lang.String fieldName)  
      int getInt​(java.sql.ResultSet rs, int idx)  
      int getInt​(java.sql.ResultSet rs, java.lang.String fieldName)  
      long getLong​(java.sql.ResultSet rs, int idx)  
      long getLong​(java.sql.ResultSet rs, java.lang.String fieldName)  
      short getShort​(java.sql.ResultSet rs, int idx)  
      short getShort​(java.sql.ResultSet rs, java.lang.String fieldName)  
      JALO getValue​(java.sql.ResultSet rs, int idx)  
      JALO getValue​(java.sql.ResultSet rs, java.lang.String fieldName)  
      protected abstract DB readValue​(java.sql.ResultSet rs, int idx)  
      protected abstract DB readValue​(java.sql.ResultSet rs, java.lang.String fieldName)  
      void setPrimitive​(java.sql.PreparedStatement stmt, int fieldIndex, boolean value)  
      void setPrimitive​(java.sql.PreparedStatement stmt, int fieldIndex, byte value)  
      void setPrimitive​(java.sql.PreparedStatement stmt, int fieldIndex, char value)  
      void setPrimitive​(java.sql.PreparedStatement stmt, int fieldIndex, double value)  
      void setPrimitive​(java.sql.PreparedStatement stmt, int fieldIndex, float value)  
      void setPrimitive​(java.sql.PreparedStatement stmt, int fieldIndex, int value)  
      void setPrimitive​(java.sql.PreparedStatement stmt, int fieldIndex, long value)  
      void setPrimitive​(java.sql.PreparedStatement stmt, int fieldIndex, short value)  
      void setPrimitive​(java.sql.PreparedStatement stmt, int fieldIndex, java.lang.String value)  
      void setValue​(java.sql.PreparedStatement stmt, int fieldIndex, JALO value)  
      java.lang.String toString()  
      protected abstract void writeValue​(java.sql.PreparedStatement stmt, int fieldIndex, DB value)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • AbstractValueReaderWriter

        public AbstractValueReaderWriter()
    • Method Detail

      • readValue

        protected abstract DB readValue​(java.sql.ResultSet rs,
                                        java.lang.String fieldName)
                                 throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • readValue

        protected abstract DB readValue​(java.sql.ResultSet rs,
                                        int idx)
                                 throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • setValue

        public final void setValue​(java.sql.PreparedStatement stmt,
                                   int fieldIndex,
                                   JALO value)
                            throws java.sql.SQLException
        Specified by:
        setValue in interface JDBCValueMappings.ValueWriter<JALO,​DB>
        Throws:
        java.sql.SQLException
      • setPrimitive

        public final void setPrimitive​(java.sql.PreparedStatement stmt,
                                       int fieldIndex,
                                       java.lang.String value)
                                throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • setPrimitive

        public final void setPrimitive​(java.sql.PreparedStatement stmt,
                                       int fieldIndex,
                                       long value)
                                throws java.sql.SQLException
        Specified by:
        setPrimitive in interface JDBCValueMappings.PrimitiveValueWriter
        Throws:
        java.sql.SQLException
      • setPrimitive

        public final void setPrimitive​(java.sql.PreparedStatement stmt,
                                       int fieldIndex,
                                       byte value)
                                throws java.sql.SQLException
        Specified by:
        setPrimitive in interface JDBCValueMappings.PrimitiveValueWriter
        Throws:
        java.sql.SQLException
      • setPrimitive

        public final void setPrimitive​(java.sql.PreparedStatement stmt,
                                       int fieldIndex,
                                       short value)
                                throws java.sql.SQLException
        Specified by:
        setPrimitive in interface JDBCValueMappings.PrimitiveValueWriter
        Throws:
        java.sql.SQLException
      • setPrimitive

        public final void setPrimitive​(java.sql.PreparedStatement stmt,
                                       int fieldIndex,
                                       float value)
                                throws java.sql.SQLException
        Specified by:
        setPrimitive in interface JDBCValueMappings.PrimitiveValueWriter
        Throws:
        java.sql.SQLException
      • setPrimitive

        public final void setPrimitive​(java.sql.PreparedStatement stmt,
                                       int fieldIndex,
                                       boolean value)
                                throws java.sql.SQLException
        Specified by:
        setPrimitive in interface JDBCValueMappings.PrimitiveValueWriter
        Throws:
        java.sql.SQLException
      • setPrimitive

        public final void setPrimitive​(java.sql.PreparedStatement stmt,
                                       int fieldIndex,
                                       double value)
                                throws java.sql.SQLException
        Specified by:
        setPrimitive in interface JDBCValueMappings.PrimitiveValueWriter
        Throws:
        java.sql.SQLException
      • setPrimitive

        public final void setPrimitive​(java.sql.PreparedStatement stmt,
                                       int fieldIndex,
                                       int value)
                                throws java.sql.SQLException
        Specified by:
        setPrimitive in interface JDBCValueMappings.PrimitiveValueWriter
        Throws:
        java.sql.SQLException
      • setPrimitive

        public final void setPrimitive​(java.sql.PreparedStatement stmt,
                                       int fieldIndex,
                                       char value)
                                throws java.sql.SQLException
        Specified by:
        setPrimitive in interface JDBCValueMappings.PrimitiveValueWriter
        Throws:
        java.sql.SQLException
      • getShort

        public final short getShort​(java.sql.ResultSet rs,
                                    java.lang.String fieldName)
                             throws java.sql.SQLException
        Specified by:
        getShort in interface JDBCValueMappings.PrimitiveValueReader
        Returns:
        0 if the db-entry was null
        Throws:
        java.sql.SQLException
      • getShort

        public final short getShort​(java.sql.ResultSet rs,
                                    int idx)
                             throws java.sql.SQLException
        Specified by:
        getShort in interface JDBCValueMappings.PrimitiveValueReader
        Returns:
        0 if the db-entry was null
        Throws:
        java.sql.SQLException
      • getLong

        public final long getLong​(java.sql.ResultSet rs,
                                  java.lang.String fieldName)
                           throws java.sql.SQLException
        Specified by:
        getLong in interface JDBCValueMappings.PrimitiveValueReader
        Returns:
        0L if the db-entry was null
        Throws:
        java.sql.SQLException
      • getLong

        public final long getLong​(java.sql.ResultSet rs,
                                  int idx)
                           throws java.sql.SQLException
        Specified by:
        getLong in interface JDBCValueMappings.PrimitiveValueReader
        Returns:
        0l if the db-entry was null
        Throws:
        java.sql.SQLException
      • getDouble

        public final double getDouble​(java.sql.ResultSet rs,
                                      java.lang.String fieldName)
                               throws java.sql.SQLException
        Specified by:
        getDouble in interface JDBCValueMappings.PrimitiveValueReader
        Returns:
        0d if the db-entry was null
        Throws:
        java.sql.SQLException
      • getDouble

        public final double getDouble​(java.sql.ResultSet rs,
                                      int idx)
                               throws java.sql.SQLException
        Specified by:
        getDouble in interface JDBCValueMappings.PrimitiveValueReader
        Returns:
        0d if the db-entry was null
        Throws:
        java.sql.SQLException
      • getChar

        public final char getChar​(java.sql.ResultSet rs,
                                  java.lang.String fieldName)
                           throws java.sql.SQLException
        Specified by:
        getChar in interface JDBCValueMappings.PrimitiveValueReader
        Returns:
        ' ' if the db-entry was null
        Throws:
        java.sql.SQLException
      • getChar

        public final char getChar​(java.sql.ResultSet rs,
                                  int idx)
                           throws java.sql.SQLException
        Specified by:
        getChar in interface JDBCValueMappings.PrimitiveValueReader
        Returns:
        '0' if the db-entry was null
        Throws:
        java.sql.SQLException
      • getByte

        public final byte getByte​(java.sql.ResultSet rs,
                                  java.lang.String fieldName)
                           throws java.sql.SQLException
        Specified by:
        getByte in interface JDBCValueMappings.PrimitiveValueReader
        Returns:
        0 if the db-entry was null
        Throws:
        java.sql.SQLException
      • getByte

        public final byte getByte​(java.sql.ResultSet rs,
                                  int idx)
                           throws java.sql.SQLException
        Specified by:
        getByte in interface JDBCValueMappings.PrimitiveValueReader
        Returns:
        0 if the db-entry was null
        Throws:
        java.sql.SQLException
      • getFloat

        public final float getFloat​(java.sql.ResultSet rs,
                                    java.lang.String fieldName)
                             throws java.sql.SQLException
        Specified by:
        getFloat in interface JDBCValueMappings.PrimitiveValueReader
        Returns:
        0d if the db-entry was null
        Throws:
        java.sql.SQLException
      • getFloat

        public final float getFloat​(java.sql.ResultSet rs,
                                    int idx)
                             throws java.sql.SQLException
        Specified by:
        getFloat in interface JDBCValueMappings.PrimitiveValueReader
        Returns:
        0d if the db-entry was null
        Throws:
        java.sql.SQLException
      • getInt

        public final int getInt​(java.sql.ResultSet rs,
                                java.lang.String fieldName)
                         throws java.sql.SQLException
        Specified by:
        getInt in interface JDBCValueMappings.PrimitiveValueReader
        Returns:
        0 if the db-entry was null
        Throws:
        java.sql.SQLException
      • getInt

        public final int getInt​(java.sql.ResultSet rs,
                                int idx)
                         throws java.sql.SQLException
        Specified by:
        getInt in interface JDBCValueMappings.PrimitiveValueReader
        Returns:
        0 if the db-entry was null
        Throws:
        java.sql.SQLException
      • getBoolean

        public final boolean getBoolean​(java.sql.ResultSet rs,
                                        java.lang.String fieldName)
                                 throws java.sql.SQLException
        Specified by:
        getBoolean in interface JDBCValueMappings.PrimitiveValueReader
        Returns:
        false if the db-entry was null
        Throws:
        java.sql.SQLException
      • getBoolean

        public final boolean getBoolean​(java.sql.ResultSet rs,
                                        int idx)
                                 throws java.sql.SQLException
        Specified by:
        getBoolean in interface JDBCValueMappings.PrimitiveValueReader
        Returns:
        false if the db-entry was null
        Throws:
        java.sql.SQLException
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • writeValue

        protected abstract void writeValue​(java.sql.PreparedStatement stmt,
                                           int fieldIndex,
                                           DB value)
                                    throws java.sql.SQLException
        Throws:
        java.sql.SQLException