The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Rose::DB::Object::Metadata::Relationship::OneToOne - One to one table relationship metadata object.

SYNOPSIS

  use Rose::DB::Object::Metadata::Relationship::OneToOne;

  $rel = Rose::DB::Object::Metadata::Relationship::OneToOne->new(...);
  $rel->make_methods(...);
  ...

DESCRIPTION

Objects of this class store and manipulate metadata for relationships in which a single row from one table refers to a single row in another table.

This class inherits from Rose::DB::Object::Metadata::Relationship. Inherited methods that are not overridden will not be documented a second time here. See the Rose::DB::Object::Metadata::Relationship documentation for more information.

METHOD MAP

get

Rose::DB::Object::MakeMethods::Generic, object_by_key, ...

See the Rose::DB::Object::Metadata::Relationship documentation for an explanation of this method map.

OBJECT METHODS

build_method_name_for_type TYPE

Return a method name for the relationship method type TYPE. Returns the relationship's name for the method type "get", undef otherwise.

foreign_key [FK]

Get or set the Rose::DB::Object::Metadata::ForeignKey object to which this object delegates all responsibility.

One to one relationships encapsulate essentially the same information as foreign keys. If a foreign key object is stored in this relationship object, then all compatible operations are passed through to the foreign key object. This includes making object method(s) and adding or modifying the local-to-foreign column map. In other words, if a foreign_key is set, the relationship object simply acts as a proxy for the foreign key object.

map_column LOCAL [, FOREIGN]

If passed a local column name LOCAL, return the corresponding column name in the foreign table. If passed both a local column name LOCAL and a foreign column name FOREIGN, set the local/foreign mapping and return the foreign column name.

column_map [HASH | HASHREF]

Get or set a reference to a hash that maps local column names to foreign column names.

type

Returns "one to one".

AUTHOR

John C. Siracusa (siracusa@mindspring.com)

COPYRIGHT

Copyright (c) 2005 by John C. Siracusa. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.