DBIx-Class-ResultSet-RecursiveUpdate

 view release on metacpan or  search on metacpan

t/lib/AnotherTestDB/OnePK/Schema/Result/Item.pm  view on Meta::CPAN

		{ data_type => "INTEGER", is_auto_increment => 1,
		is_nullable => 0 },
		);
__PACKAGE__->set_primary_key("idcol");


__PACKAGE__->has_many(
		"relateditems",
		"AnotherTestDB::OnePK::Schema::Result::RelatedItem",
		{ "foreign.item_id" => "self.idcol" },
		{ cascade_copy => 0, cascade_delete => 0 },
		);

__PACKAGE__->has_many(
		"true_relateditems",
		"AnotherTestDB::OnePK::Schema::Result::RelatedItem",
		{ "foreign.item_id" => "self.idcol" },
		{where => { 'conditionitems.condition' => 'true'},
		'join' => qq/conditionitems/,
		 cascade_copy => 0, cascade_delete => 0 },
		);
1;

t/lib/AnotherTestDB/OnePK/Schema/Result/RelatedItem.pm  view on Meta::CPAN

__PACKAGE__->belongs_to(
		'item',
		'AnotherTestDB::OnePK::Schema::Result::Item',
		{ idcol => 'item_id'},
		);

__PACKAGE__->has_many(
		"conditionitems",
		"AnotherTestDB::OnePK::Schema::Result::ConditionItem",
		{ "foreign.rel_item_id" => "self.idcol" },
		{ cascade_copy => 0, cascade_delete => 0 },
		);


__PACKAGE__->set_primary_key("idcol");

1;

t/lib/AnotherTestDB/TwoPK/Schema/Result/Item.pm  view on Meta::CPAN

		{ data_type => "INTEGER", is_auto_increment => 1,
		is_nullable => 0 },
		);
__PACKAGE__->set_primary_key("idcol");


__PACKAGE__->has_many(
		"relateditems",
		"AnotherTestDB::TwoPK::Schema::Result::RelatedItem",
		{ "foreign.item_id" => "self.idcol" },
		{ cascade_copy => 0, cascade_delete => 0 },
		);

__PACKAGE__->has_many(
		"true_relateditems",
		"AnotherTestDB::TwoPK::Schema::Result::RelatedItem",
		{ "foreign.item_id" => "self.idcol" },
		{where => { 'conditionitems.condition' => 'true'},
		'join' => qq/conditionitems/,
		 cascade_copy => 0, cascade_delete => 0 },
		);
1;

t/lib/AnotherTestDB/TwoPK/Schema/Result/RelatedItem.pm  view on Meta::CPAN

__PACKAGE__->belongs_to(
		'item',
		'AnotherTestDB::TwoPK::Schema::Result::Item',
		{ idcol => 'item_id'},
		);

__PACKAGE__->has_many(
		"conditionitems",
		"AnotherTestDB::TwoPK::Schema::Result::ConditionItem",
		{ "foreign.rel_item_id" => "self.idcol" },
		{ cascade_copy => 0, cascade_delete => 0 },
		);


__PACKAGE__->set_primary_key("idcol", "item_id");

1;

t/lib/DBICTest/Schema/Artist.pm  view on Meta::CPAN

__PACKAGE__->has_many(
    cds_unordered => 'DBICTest::Schema::CD'
);

__PACKAGE__->has_many( twokeys => 'DBICTest::Schema::TwoKeys' );
__PACKAGE__->has_many( onekeys => 'DBICTest::Schema::OneKey' );

__PACKAGE__->has_many(
  artist_undirected_maps => 'DBICTest::Schema::ArtistUndirectedMap',
  [ {'foreign.id1' => 'self.artistid'}, {'foreign.id2' => 'self.artistid'} ],
  { cascade_copy => 0 } # this would *so* not make sense
);

__PACKAGE__->has_many(
    artist_to_artwork => 'DBICTest::Schema::Artwork_to_Artist' => 'artist_id'
);
__PACKAGE__->many_to_many('artworks', 'artist_to_artwork', 'artwork');


sub sqlt_deploy_hook {
  my ($self, $sqlt_table) = @_;

t/lib/DBSchema/Result/Owner.pm  view on Meta::CPAN

Type: has_many

Related object: L<DBSchema::Result::Podcast>

=cut

__PACKAGE__->has_many(
  "podcasts",
  "DBSchema::Result::Podcast",
  { "foreign.owner_id" => "self.id" },
  { cascade_copy => 0, cascade_delete => 0 },
);


1;

t/lib/TwoPkHasManyDB/Schema/Result/Item.pm  view on Meta::CPAN

		{ data_type => "INTEGER", is_auto_increment => 1,
		is_nullable => 0 },
		);
__PACKAGE__->set_primary_key("id");


__PACKAGE__->has_many(
		"relateditems",
		"TwoPkHasManyDB::Schema::Result::RelatedItem",
		{ "foreign.item_id" => "self.id" },
		{ cascade_copy => 0, cascade_delete => 0 },
		);

__PACKAGE__->has_many(
		"relateditems2",
		"TwoPkHasManyDB::Schema::Result::RelatedItem2",
		{ "foreign.item_id" => "self.id" },
		{ cascade_copy => 0, cascade_delete => 0 },
		);
1;

t_dbic/lib/DBICTest/BaseResult.pm  view on Meta::CPAN


__PACKAGE__->table ('bogus');
__PACKAGE__->resultset_class ('DBICTest::BaseResultSet');

#sub add_relationship {
#  my $self = shift;
#  my $opts = $_[3] || {};
#  if (grep { $_ eq $_[0] } qw/
#    cds_90s cds_80s cds_84 artist_undirected_maps mapped_artists last_track
#  /) {
#    # nothing - join-dependent or non-cascadeable relationship
#  }
#  elsif ($opts->{is_foreign_key_constraint}) {
#    $opts->{on_update} ||= 'cascade';
#  }
#  else {
#    $opts->{cascade_rekey} = 1
#      unless ref $_[2] eq 'CODE';
#  }
#  $self->next::method(@_[0..2], $opts);
#}

1;

t_dbic/lib/DBICTest/Schema/Artist.pm  view on Meta::CPAN

__PACKAGE__->has_many(
    cds_very_very_very_long_relationship_name => 'DBICTest::Schema::CD'
);

__PACKAGE__->has_many( twokeys => 'DBICTest::Schema::TwoKeys' );
__PACKAGE__->has_many( onekeys => 'DBICTest::Schema::OneKey' );

__PACKAGE__->has_many(
  artist_undirected_maps => 'DBICTest::Schema::ArtistUndirectedMap',
  [ {'foreign.id1' => 'self.artistid'}, {'foreign.id2' => 'self.artistid'} ],
  { cascade_copy => 0 } # this would *so* not make sense
);

__PACKAGE__->has_many(
    artwork_to_artist => 'DBICTest::Schema::Artwork_to_Artist' => 'artist_id'
);
__PACKAGE__->many_to_many('artworks', 'artwork_to_artist', 'artwork');


sub sqlt_deploy_hook {
  my ($self, $sqlt_table) = @_;

t_dbic/lib/DBICTest/Schema/ArtistUndirectedMap.pm  view on Meta::CPAN

  'id1' => { data_type => 'integer' },
  'id2' => { data_type => 'integer' },
);
__PACKAGE__->set_primary_key(qw/id1 id2/);

__PACKAGE__->belongs_to( 'artist1', 'DBICTest::Schema::Artist', 'id1', { on_delete => 'RESTRICT', on_update => 'CASCADE'} );
__PACKAGE__->belongs_to( 'artist2', 'DBICTest::Schema::Artist', 'id2', { on_delete => undef, on_update => undef} );
__PACKAGE__->has_many(
  'mapped_artists', 'DBICTest::Schema::Artist',
  [ {'foreign.artistid' => 'self.id1'}, {'foreign.artistid' => 'self.id2'} ],
  { cascade_delete => 0 },
);

1;

t_dbic/lib/DBICTest/Schema/Link.pm  view on Meta::CPAN

        is_nullable => 1,
    },
    'title' => {
        data_type => 'varchar',
        size      => 100,
        is_nullable => 1,
    },
);
__PACKAGE__->set_primary_key('id');

__PACKAGE__->has_many ( bookmarks => 'DBICTest::Schema::Bookmark', 'link', { cascade_delete => 0 } );

use overload '""' => sub { shift->url }, fallback=> 1;

1;



( run in 0.546 second using v1.01-cache-2.11-cpan-49f99fa48dc )