private static < D , T > D createDaoFromConfig ( ConnectionSource connectionSource , Class < T > clazz ) throws SQLException { // no loaded configs if ( configMap == null ) { return null ; } @ SuppressWarnings ( "unchecked" ) DatabaseTableConfig < T > config = ( DatabaseTableConfig < T > ) configMap . get ( clazz ) ; // if we don't config information cached return null if ( config == null ) { return null ; } // else create a DAO using configuration Dao < T , ? > configedDao = doCreateDao ( connectionSource , config ) ; @ SuppressWarnings ( "unchecked" ) D castDao = ( D ) configedDao ; return castDao ; }
Creates the DAO if we have config information cached and caches the DAO .