Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

tangram::type::array::frommany(3pm) [debian man page]

Tangram::Type::Array::FromMany(3pm)			User Contributed Perl Documentation		       Tangram::Type::Array::FromMany(3pm)

NAME
Tangram::Type::Array::FromMany - map Perl arrays using a link table SYNOPSIS
use Tangram; # or use Tangram::Core; use Tangram::Type::Array::FromMany; $schema = Tangram::Schema->new( classes => { Company => { fields => { array => { # long form employee => { class => 'Person', table => 'Company_employees', coll => 'company', item => 'employee', slot => 'slot' }, # short form assets => 'Asset', } DESCRIPTION
Maps references to a Perl array. The persistent fields are grouped in a hash under the "array" key in the field hash. The array may contain only objects of persistent classes. These classes must have a common persistent base class. Tangram uses a link table to save the state of the collection. The table has three columns, which contain * the id of the container objects * the id of the elements * the position of the element in the array The field names are passed in a hash that associates a field name with a field descriptor. The field descriptor may be either a hash or a string. The hash uses the following fields: * class * aggreg * table * coll * item * slot * deep_update Mandatory field "class" specifies the class of the elements. Optional field "aggreg" specifies that the elements of the collection must be removed (erased) from persistent storage along with the con- taining object. The default is not to aggregate. Optional field "table" sets the name of the link table. This defaults to 'C_F', where C is the class of the containing object and F is the field name. Optional field "coll" sets the name the column containing the ids of the containing objects. This defaults to 'coll'. Optional field "item" sets the name the column containing the ids of the elements. This defaults to 'item'. Optional field "slot" sets the name the column containing the position of the elements. This defaults to 'slot'. Optional field "deep_update" specificies that all elements have to be updated automatically when "update" is called on the collection object. Automatic update ensures consisitency between the Perl representation and the DBMS state, but degrades update performance so use it with caution. The default is not to do automatic updates. If the descriptor is a string, it is interpreted as the name of the element's class. This is equivalent to specifying only the "class" field in the hash variant. perl v5.8.8 2006-03-29 Tangram::Type::Array::FromMany(3pm)

Check Out this Related Man Page

Tangram::Type::Set::FromOne(3pm)			User Contributed Perl Documentation			  Tangram::Type::Set::FromOne(3pm)

NAME
Tangram::Type::Set::FromOne - map Set::Object using a foreign key SYNOPSIS
use Tangram; # or use Tangram::Core; use Tangram::Type::Set::FromOne; $schema = Tangram::Schema->new( classes => { Basket => { fields => { iset => { # long form fruits => { class => 'Fruit', coll => 'basket', }, # or (short form) fruits => 'Fruit', } DESCRIPTION
This class maps references to Set::Object collections in an intrusive fashion. The persistent fields are grouped in a hash under the "iset" key in the field hash. The set may contain only objects of persistent classes. These classes must have a common persistent base class. Tangram uses a column on the element's table to store the id of the object containing the collection. CAUTION: the same object may not be an element of the same collection, in two different objects. This mapping may be used only for one-to- many relationships. The field names are passed in a hash that associates a field name with a field descriptor. The field descriptor may be either a hash or a string. The hash uses the following fields: * class Mandatory field "class" specifies the class of the elements. * aggreg Optional field "aggreg" specifies that the elements of the collection must be removed (erased) from persistent storage along with the containing object. The default is not to aggregate. * back Optional field "back" sets the name of a field that is inserted in the elements. That field acts as a demand-loaded, read-only refer- ence to the object containing the collection. * coll Optional field "coll" sets the name the column containing the id of the containing object. This defaults to 'C_m', where 'C' is the class of the containing object (after passing through the normalisation function), and 'm' is the field name. * deep_update Optional field "deep_update" specificies that all elements have to be updated automatically when "update" is called on the collection object. Automatic update ensures consisitency between the Perl representation and the DBMS state, but degrades update performance so use it with caution. The default is not to do automatic updates. If the descriptor is a string, it is interpreted as the name of the element's class. This is equivalent to specifying only the "class" field in the hash variant. perl v5.8.8 2006-03-29 Tangram::Type::Set::FromOne(3pm)
Man Page