Changeset 998

Show
Ignore:
Timestamp:
02/14/04 00:16:24
Author:
miyagawa
Message:

fix _class_name to table_alias

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • Class-DBI-View/trunk/Changes

    r861 r998  
    11Revision history for Perl extension Class::DBI::View 
     2 
     30.04  Sat Feb 14 00:06:35 JST 2004 
     4        * Fixed _class_name to table_alias() 
     5          Now it needs Class::DBI 0.94 or over 
     6          (Thanks to Yoshimune Kitta and Atsushi Baba) 
     7        - Fixed test suite so it doesn't fail without SQLite 
    28 
    390.03  Fri Feb 28 18:11:16 JST 2003 
  • Class-DBI-View/trunk/Makefile.PL

    r857 r998  
    66        Test::More => 0.32, 
    77        UNIVERSAL::require => 0, 
    8         Class::DBI => 0.90
     8        Class::DBI => 0.94
    99    }, 
    1010); 
  • Class-DBI-View/trunk/lib/Class/DBI/View/TemporaryTable.pm

    r861 r998  
    1818    *{"$pkg\::$method"} = sub { 
    1919        my $class = shift; 
    20         my $temp_table = $class->_class_name
     20        my $temp_table = $class->table_alias
    2121        if ($args{cache_for_session}) { 
    2222            $class->db_Main->do("CREATE TEMPORARY TABLE IF NOT EXISTS $temp_table $sql"); 
  • Class-DBI-View/trunk/t/lib/CD/Music.pm

    r857 r998  
    11package CD::Music::mysql; 
    22use strict; 
    3 use base qw(CD::mysql); 
    43 
    5 __PACKAGE__->construct; 
    6 __PACKAGE__->set_up_table("music"); 
     4sub init { 
     5    require CD::mysql; 
     6    @CD::Music::mysql::ISA = qw(CD::mysql); 
     7 
     8    __PACKAGE__->construct; 
     9    __PACKAGE__->set_up_table("music"); 
     10
    711 
    812sub construct { 
     
    1721SQL 
    1822    ; 
    19     END { $class->destruct; } 
     23    END { $class->destruct if $class; } 
    2024} 
    2125 
     
    2529 
    2630package CD::Music::SQLite; 
    27 use base qw(CD::SQLite); 
    2831 
    29 __PACKAGE__->construct; 
    30 __PACKAGE__->set_up_table("music"); 
     32sub init { 
     33    require CD::SQLite; 
     34    @CD::Music::SQLite::ISA = qw(CD::SQLite); 
     35 
     36    __PACKAGE__->construct; 
     37    __PACKAGE__->set_up_table("music"); 
     38
    3139 
    3240sub construct { 
     
    4149SQL 
    4250    ; 
    43     END { $class->destruct; } 
     51    END { $class->destruct if $class; } 
    4452} 
    4553 
  • Class-DBI-View/trunk/t/lib/CD/Tester.pm

    r861 r998  
    1111        require DBI; 
    1212        DBI->connect('dbi:mysql:test', '', '') or die $DBI::errstr; 
     13        CD::Music::mysql->init(); 
    1314    }; 
    1415    return !$@; 
     
    2122        DBI->connect("dbi:SQLite:dbname=$dbname") or die $DBI::errstr; 
    2223        unlink $dbname; 
     24        CD::Music::SQLite->init(); 
    2325    }; 
    2426    return !$@