Rose::DB::Object::Metadata::ForeignKey - Foreign key metadata.
use Rose::DB::Object::Metadata::ForeignKey; $fk = Rose::DB::Object::Metadata::ForeignKey->new(...); $fk->make_method(...); ...
Objects of this class store and manipulate metadata for foreign keys in a database table. It stores information about which columns in the local table map to which columns in the foreign table, and is responsible for creating an accessor method for the foreign object.
This class represents (and will create an accessor method for) the thing referenced by the foreign key column(s). You'll still need accessor method(s) for the foreign key column(s) themselves.
the thing referenced by
Both the local table and the foreign table will need Rose::DB::Object-derived classes fronting them.
Since there is a lot of overlap in responsibilities, this class inherits from Rose::DB::Object::Metadata::Column. Inherited methods that are not overridden will not be documented a second time here. See the Rose::DB::Object::Metadata::Column documentation for more information.
Get or set the class name of the Rose::DB::Object-derived object that encapsulates rows from the table referenced by the foreign key column(s).
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.
Get or set a reference to a hash that maps local column names to foreign column names in the table referenced by the foreign key.
Returns Rose::DB::Object::MakeMethods::Generic.
Returns object_by_key.
object_by_key
Get or set the boolean flag that determines whether the db attribute of the current object is shared with the foreign object to be fetched. The default value is true.
db
Returns "foreign key".
John C. Siracusa (siracusa@mindspring.com)
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.
To install Rose::DB::Object, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Rose::DB::Object
CPAN shell
perl -MCPAN -e shell install Rose::DB::Object
For more information on module installation, please visit the detailed CPAN module installation guide.