The functionality introduced in 7ad80222 requires a certain CDBI
[dbsrgits/DBIx-Class-Historic.git] / lib / DBIx / Class / SQLMaker / OracleJoins.pm
index 0313a4f..fe9bd07 100644 (file)
@@ -1,5 +1,4 @@
-package # Hide from PAUSE
-  DBIx::Class::SQLMaker::OracleJoins;
+package DBIx::Class::SQLMaker::OracleJoins;
 
 use warnings;
 use strict;
@@ -81,10 +80,24 @@ sub _recurse_oracle_joins {
         && $jt !~ /inner/i;
     }
 
+    # FIXME - the code below *UTTERLY* doesn't work with custom conds... sigh
+    # for the time being do not do any processing with the likes of _collapse_cond
+    # instead only unroll the -and hack if present
+    $on = $on->{-and}[0] if (
+      ref $on eq 'HASH'
+        and
+      keys %$on == 1
+        and
+      ref $on->{-and} eq 'ARRAY'
+        and
+      @{$on->{-and}} == 1
+    );
+
+    # sadly SQLA treats where($scalar) as literal, so we need to jump some hoops
     push @where, map { \sprintf ('%s%s = %s%s',
-      $self->_quote($_),
+      ref $_ ? $self->_recurse_where($_) : $self->_quote($_),
       $left_join,
-      $self->_quote($on->{$_}),
+      ref $on->{$_} ? $self->_recurse_where($on->{$_}) : $self->_quote($on->{$_}),
       $right_join,
     )} keys %$on;
   }
@@ -94,7 +107,7 @@ sub _recurse_oracle_joins {
 
 1;
 
-=pod
+__END__
 
 =head1 NAME
 
@@ -152,17 +165,13 @@ Does not support full outer joins (however neither really does DBIC itself)
 
 =back
 
-=head1 AUTHOR
+=head1 FURTHER QUESTIONS?
 
-Justin Wheeler C<< <jwheeler@datademons.com> >>
+Check the list of L<additional DBIC resources|DBIx::Class/GETTING HELP/SUPPORT>.
 
-=head1 CONTRIBUTORS
-
-David Jack Olrik C<< <djo@cpan.org> >>
-
-=head1 LICENSE
-
-This module is licensed under the same terms as Perl itself.
-
-=cut
+=head1 COPYRIGHT AND LICENSE
 
+This module is free software L<copyright|DBIx::Class/COPYRIGHT AND LICENSE>
+by the L<DBIx::Class (DBIC) authors|DBIx::Class/AUTHORS>. You can
+redistribute it and/or modify it under the same terms as the
+L<DBIx::Class library|DBIx::Class/COPYRIGHT AND LICENSE>.