File Coverage

blib/lib/Rose/DBx/Object/Metadata/Column/Xml.pm
Criterion Covered Total %
statement 7 9 77.7
branch n/a
condition n/a
subroutine 3 3 100.0
pod n/a
total 10 12 83.3


line stmt bran cond sub pod time code
1             package Rose::DBx::Object::Metadata::Column::Xml;
2 1     1   31998 use strict;
  1         3  
  1         44  
3 1     1   1192 use Rose::DB::Object::Metadata::Column::Text;
  1         438102  
  1         62  
4             our @ISA = qw(Rose::DB::Object::Metadata::Column::Text);
5              
6 1     1   509 use DBD::Oracle qw(:ora_types);
  0            
  0            
7              
8             our $VERSION = '0.782';
9              
10             sub type { 'xml' }
11              
12             sub dbi_requires_bind_param
13             {
14             my($self, $db) = @_;
15             return $db->driver eq 'oracle' ? 1 : 0;
16             }
17              
18             sub dbi_bind_param_attrs
19             {
20             my($self, $db) = @_;
21             return $db->driver eq 'oracle' ? ORA_XMLTYPE : undef;
22             }
23              
24             sub select_sql
25             {
26             my($self, $db, $table) = @_;
27             if ($db) {
28             $table = $table ? "$table." : '';
29             return $db->driver eq 'oracle' ? "$table$self->{name}.getClobVal()" : "$table$self->{name}";
30             } else {
31             return $self->{name};
32             }
33             }
34              
35             1;
36              
37             __END__