1Rose::DB::Object::MetadUastearR:o:CsRoeen:lt:arDtiBib:ou:ntOsebhdjiepPc:et:r:Ol:nMeDeTotocaOudnmaeet(na3t:)a:tRieolnationship::OneToOne(3)
2
3
4
6 Rose::DB::Object::Metadata::Relationship::OneToOne - One to one table
7 relationship metadata object.
8
10 use Rose::DB::Object::Metadata::Relationship::OneToOne;
11
12 $rel = Rose::DB::Object::Metadata::Relationship::OneToOne->new(...);
13 $rel->make_methods(...);
14 ...
15
17 Objects of this class store and manipulate metadata for relationships
18 in which a single row from one table refers to a single row in another
19 table.
20
21 This class inherits from Rose::DB::Object::Metadata::Relationship.
22 Inherited methods that are not overridden will not be documented a
23 second time here. See the Rose::DB::Object::Metadata::Relationship
24 documentation for more information.
25
27 "get_set"
28 Rose::DB::Object::MakeMethods::Generic, object_by_key, ...
29
30 "get_set_now"
31 Rose::DB::Object::MakeMethods::Generic, object_by_key, "interface
32 => 'get_set_now'"
33
34 "get_set_on_save"
35 Rose::DB::Object::MakeMethods::Generic, object_by_key, "interface
36 => 'get_set_on_save'"
37
38 "delete_now"
39 Rose::DB::Object::MakeMethods::Generic, object_by_key, "interface
40 => 'delete_now'"
41
42 "delete_on_save"
43 Rose::DB::Object::MakeMethods::Generic, object_by_key, "interface
44 => 'delete_on_save'"
45
46 See the Rose::DB::Object::Metadata::Relationship documentation for an
47 explanation of this method map.
48
50 default_auto_method_types [TYPES]
51 Get or set the default list of auto_method_types. TYPES should be
52 a list of relationship method types. Returns the list of default
53 relationship method types (in list context) or a reference to an
54 array of the default relationship method types (in scalar context).
55 The default list contains "get_set_on_save" and "delete_on_save".
56
58 column_map [HASH | HASHREF]
59 Get or set a reference to a hash that maps local column names to
60 foreign column names.
61
62 build_method_name_for_type TYPE
63 Return a method name for the relationship method type TYPE.
64
65 For the method types "get_set", "get_set_now", and
66 "get_set_on_save", the relationship's name is returned.
67
68 For the method types "delete_now" and "delete_on_save", the
69 relationship's name prefixed with "delete_" is returned.
70
71 Otherwise, undef is returned.
72
73 is_singular
74 Returns true.
75
76 foreign_key [FK]
77 Get or set the Rose::DB::Object::Metadata::ForeignKey object to
78 which this object delegates all responsibility.
79
80 One to one relationships encapsulate essentially the same
81 information as foreign keys. If a foreign key object is stored in
82 this relationship object, then all compatible operations are passed
83 through to the foreign key object. This includes making object
84 method(s) and adding or modifying the local-to-foreign column map.
85 In other words, if a foreign_key is set, the relationship object
86 simply acts as a proxy for the foreign key object.
87
88 manager_class [CLASS]
89 Get or set the name of the Rose::DB::Object::Manager-derived class
90 used to fetch the object.
91
92 manager_method [METHOD]
93 Get or set the name of the manager_class class method to call when
94 fetching the object.
95
96 manager_args [HASHREF]
97 Get or set a reference to a hash of name/value arguments to pass to
98 the manager_method when fetching the object. See the documentation
99 for Rose::DB::Object::Manager's get_objects method for a full list
100 of valid arguments for use with the "manager_args" parameter.
101
102 Note: when the name of a relationship that has "manager_args" is
103 used in a Rose::DB::Object::Manager with_objects or require_objects
104 parameter value, only the sort_by argument will be copied from
105 "manager_args" and incorporated into the query.
106
107 map_column LOCAL [, FOREIGN]
108 If passed a local column name LOCAL, return the corresponding
109 column name in the foreign table. If passed both a local column
110 name LOCAL and a foreign column name FOREIGN, set the local/foreign
111 mapping and return the foreign column name.
112
113 optional [BOOL]
114 This method is the mirror image of the required method. Passing a
115 true value to this method is the same thing as setting required to
116 false, and vice versa. Similarly, the return value is the logical
117 negation of required.
118
119 query_args [ARRAYREF]
120 Get or set a reference to an array of query arguments to add to the
121 query passed to the manager_method when fetching the object.
122
123 required [BOOL]
124 Get or set the boolean value that determines what happens when the
125 local columns in the column_map have defined values, but the object
126 they relate to is not found. If true, a fatal error will occur
127 when the methods that fetch objects through this relationship are
128 called. If false, then the methods will simply return undef.
129
130 The default is false if one or more of the local columns allow null
131 values or if the local columns in the column map are the same as
132 the primary key columns, true otherwise.
133
134 type
135 Returns "one to one".
136
138 John C. Siracusa (siracusa@gmail.com)
139
141 Copyright (c) 2010 by John C. Siracusa. All rights reserved. This
142 program is free software; you can redistribute it and/or modify it
143 under the same terms as Perl itself.
144
145
146
147perl v5.28.1 Rose::DB:2:0O1b5j-e0c3t-:1:8Metadata::Relationship::OneToOne(3)