private <K, T extends Persistable<K>> CastorDao<K, T> _createDao(
                    final Class<T> type
                    )
    {
        String  daoClazzName = _typeMapping.get( type.getName() );
        if (_LOG_.isDebugEnabled()) {
            _LOG_.debug( "creating Dao: object type=" + type
                            + ", Dao type=" + daoClazzName );
        }

        CastorDao<K, T>  dao = null;
        if (daoClazzName == null) {
            dao = new CastorDao<K, T>( type );
        } else {
            try {
                @SuppressWarnings( "unchecked" )
                Class<CastorDao<K, T>>  daoClazz =
                    (Class<CastorDao<K, T>>)Class.forName( daoClazzName );
                dao = daoClazz.newInstance();
                               //throws InstantiationException, IllegalAccessException
            } catch (Exception ex) {
                throw new PersistenceException( ex );
            }
        }

        if (CastorDaoSupport.class.isInstance( dao )) {
            CastorDaoSupport  support = CastorDaoSupport.class.cast( dao );
            support.setJDOManager( _jdoManager );
        }

        return dao;
    }
private < K , T extends Persistable < K > > CastorDao < K , T > _createDao ( final Class < T > type ) { String daoClazzName = _typeMapping . get ( type . getName ( ) ) ; if ( _LOG_ . isDebugEnabled ( ) ) { _LOG_ . debug ( "creating Dao: object type=" + type + ", Dao type=" + daoClazzName ) ; } CastorDao < K , T > dao = null ; if ( daoClazzName == null ) { dao = new CastorDao < K , T > ( type ) ; } else { try { @ SuppressWarnings ( "unchecked" ) Class < CastorDao < K , T > > daoClazz = ( Class < CastorDao < K , T > > ) Class . forName ( daoClazzName ) ; dao = daoClazz . newInstance ( ) ; } catch ( Exception ex ) { throw new PersistenceException ( ex ) ; } } if ( CastorDaoSupport . class . isInstance ( dao ) ) { CastorDaoSupport support = CastorDaoSupport . class . cast ( dao ) ; support . setJDOManager ( _jdoManager ) ; } return dao ; }
Creates a Dao for the specified object type.