Class ReadWriteDataSource

java.lang.Object
org.springframework.jdbc.datasource.AbstractDataSource
org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource
de.jbellmann.rwds.ReadWriteDataSource
All Implemented Interfaces:
Wrapper, CommonDataSource, DataSource, org.springframework.beans.factory.InitializingBean

public class ReadWriteDataSource extends org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    protected static enum 
     
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected static final ThreadLocal<ReadWriteDataSource.Type>
     

    Fields inherited from class org.springframework.jdbc.datasource.AbstractDataSource

    logger
  • Constructor Summary

    Constructors
    Constructor
    Description
    ReadWriteDataSource(DataSource writeDataSource, DataSource readDataSource)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected Object
     

    Methods inherited from class org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource

    afterPropertiesSet, determineTargetDataSource, getConnection, getConnection, getResolvedDataSources, getResolvedDefaultDataSource, isWrapperFor, resolveSpecifiedDataSource, resolveSpecifiedLookupKey, setDataSourceLookup, setDefaultTargetDataSource, setLenientFallback, setTargetDataSources, unwrap

    Methods inherited from class org.springframework.jdbc.datasource.AbstractDataSource

    getLoginTimeout, getLogWriter, getParentLogger, setLoginTimeout, setLogWriter

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface javax.sql.CommonDataSource

    createShardingKeyBuilder

    Methods inherited from interface javax.sql.DataSource

    createConnectionBuilder
  • Field Details

  • Constructor Details

    • ReadWriteDataSource

      public ReadWriteDataSource(DataSource writeDataSource, DataSource readDataSource)
  • Method Details

    • determineCurrentLookupKey

      protected Object determineCurrentLookupKey()
      Specified by:
      determineCurrentLookupKey in class org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource