should, set this attribute to a true or false value to override the detection
of when to create constraints.
+=item cascade_copy
+
+If C<cascade_copy> is true on a C<has_many> relationship for an
+object, then when you copy the object all the related objects will
+be copied too. To turn this behaviour off, pass C<< cascade_copy => 0 >>
+in the C<$attr> hashref. The behaviour defaults to C<< cascade_copy => 1 >>.
+
+=item cascade_delete
+
+By default, DBIx::Class cascades deletes across C<has_many> and
+C<might_have> relationships. You can disable this behaviour on a
+per-relationship basis by supplying C<< cascade_delete => 0 >> in the
+relationship attributes.
+
+The cascaded operations are performed after the requested delete,
+so if your database has a constraint on the relationship, it will
+have deleted/updated the related records or raised an exception
+before DBIx::Class gets to perform the cascaded operation.
+
+=item cascade_update
+
+By default, DBIx::Class cascades updates across C<has_many> and
+C<might_have> relationships. You can disable this behaviour on a
+per-relationship basis by supplying C<< cascade_update => 0 >> in the
+relationship attributes.
+
+The cascaded operations are performed after the requested update,
+so if your database has a constraint on the relationship, it will
+have updated/updated the related records or raised an exception
+before DBIx::Class gets to perform the cascaded operation.
+
=item on_delete / on_update
If you are using L<SQL::Translator> to create SQL for you, you can use these
my $query = ((@_ > 1) ? {@_} : shift);
my $source = $self->result_source;
- my $cond = $source->_resolve_condition(
- $rel_info->{cond}, $rel, $self
- );
+
+ # condition resolution may fail if an incomplete master-object prefetch
+ # is encountered - that is ok during prefetch construction (not yet in_storage)
+ my $cond = eval { $source->_resolve_condition( $rel_info->{cond}, $rel, $self ) };
+ if (my $err = $@) {
+ if ($self->in_storage) {
+ $self->throw_exception ($err);
+ }
+ else {
+ $cond = $DBIx::Class::ResultSource::UNRESOLVABLE_CONDITION;
+ }
+ }
+
if ($cond eq $DBIx::Class::ResultSource::UNRESOLVABLE_CONDITION) {
my $reverse = $source->reverse_relationship_info($rel);
foreach my $rev_rel (keys %$reverse) {
( $objects_rs ) = $rs->search_related_rs('relname', $cond, $attrs);
This method works exactly the same as search_related, except that
-it guarantees a restultset, even in list context.
+it guarantees a resultset, even in list context.
=cut
call set_from_related on the book.
This is called internally when you pass existing objects as values to
-L<DBIx::Class::ResultSet/create>, or pass an object to a belongs_to acessor.
+L<DBIx::Class::ResultSet/create>, or pass an object to a belongs_to accessor.
The columns are only set in the local copy of the object, call L</update> to
set them in the storage.