Uploaded image for project: 'Spring Data JDBC'
  1. Spring Data JDBC
  2. DATAJDBC-287

Document the usage of JdbcConfiguration

    XMLWordPrintable

    Details

      Description

      Please document the possibility to configure customer converters by overriding JdbcConfiguration. 

       Reason/source for the task: https://stackoverflow.com/questions/53120420/does-spring-data-jdbc-support-custom-type-converters

      Example related to my question:

      @Configuration
      public class DataJdbcConfiguration extends JdbcConfiguration { 
      
      @Override 
      protected JdbcCustomConversions jdbcCustomConversions() { 
          return new JdbcCustomConversions(
               Arrays.asList(new Converter<TIMESTAMPTZ, Date>() {
                    @Override public Date convert(TIMESTAMPTZ source) { 
                          try { 
                               return source.dateValue(); 
                          } catch (SQLException e) { 
                               throw new CustomConverterException(); 
                          } 
                    } 
               })); 
           }
      }
      

        Attachments

          Activity

            People

            Assignee:
            schauder Jens Schauder
            Reporter:
            evgdim Evgeni Dimitrov
            Last updater:
            Mark Paluch
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: