public synchronized static < D extends Dao < T , ? > , T > D lookupDao ( ConnectionSource connectionSource , Class < T > clazz ) { if ( connectionSource == null ) { throw new IllegalArgumentException ( "connectionSource argument cannot be null" ) ; } ClassConnectionSource key = new ClassConnectionSource ( connectionSource , clazz ) ; Dao < ? , ? > dao = lookupDao ( key ) ; @ SuppressWarnings ( "unchecked" ) D castDao = ( D ) dao ; return castDao ; }
Helper method to lookup a DAO if it has already been associated with the class . Otherwise this returns null .