Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

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

Tangram::Type::TimeAndDate(3pm) 			User Contributed Perl Documentation			   Tangram::Type::TimeAndDate(3pm)

NAME
Tangram::Type::TimeAndDate - map date & time fields SYNOPSIS
use Tangram; # any of: use Tangram::Type::Date; # RAW - use with caution use Tangram::Type::Time; use Tangram::Type::Date::Cooked; # pure ISO-8601 use Tangram::Type::Date::DateTime; use Tangram::Type::Date::Manip; use Tangram::Type::Date::TimePiece; Tangram::Schema->new( classes => { NaturalPerson => { fields => { rawdatetime => [ qw( birth death ) ], rawdate => [ qw( depart return ) ], rawtime => [ qw( breakfast lunch dinner ) ], cookeddatetime => [ qw( cooked ) ], dmdatetime => [ qw( datemanip ) ], timepiece => [ qw( fob ) ], datetime => [ qw( bloat ) ], DESCRIPTION
These classes are responsible for mapping strings to SQL date or time types. These classes are not imported by Tangram.pm, thus they must be explicitly imported via a "use" directive. The three typetags "rawdate", "rawtime" and "rawdatetime" are for mapping strings to SQL date/time types, for databases that differentiate between "dates" and "times". 'Raw' means that Tangram doesn't attempt to interpret the strings, it merely passes them down to DBI. "cookeddatetime" is like "rawdatetime" except that the date is converted from the DBMS format to ISO-8601 in the form : YYYY-MM-DDTHH:MM:SS for example: 2004-12-25T13:14:15 Other modules then further cook this ISO date into an object as is the convention for a particular module. This only works with back-ends that allow per-connection settings for the default date format, such as Tangram::Driver::Oracle. On the way back out, the date is converted back to the DBMS format. This is achieved via vendor-specific functions mentioned in "Tan- gram::Relational". The persistent fields may be specified either as a hash or as an array of field names. In the hash form, each entry consists in a field name and an associated option hash. The option hash may contain the following fields: * col * sql "col" sets the name of the column used to store the field's value. This field is optional, it defaults to the persistent field name. Over- ride if the field name is not an acceptable SQL column name. "sql" sets the SQL type of the column. Used by Schema::deploy() when initializing a database. Defaults to 'VARCHAR(255) NULL' for strings, 'INT NULL' for ints and 'REAL NULL' for reals. The persistent fields may also be specified as an array of strings, in which case the defaults are used. perl v5.8.8 2006-03-29 Tangram::Type::TimeAndDate(3pm)

Check Out this Related Man Page

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

NAME
Tangram::Type::Array::FromOne - map Perl arrays using a foreign key SYNOPSIS
use Tangram; # or use Tangram::Core; use Tangram::Type::Array::FromOne; $schema = Tangram::Schema->new( classes => { Agenda => { fields => { iarray => { # long form entries => { class => 'Entry', coll => 'agenda', }, # or (short form) entries => 'Entry', } DESCRIPTION
This class maps references to a Perl array in an intrusive fashion. The persistent fields are grouped in a hash under the "iarray" 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 two columns on the element's table to store: * the id of the object containing the collection * the position of the element in 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 * aggreg * back * coll * 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 "back" sets the name of a field that is inserted in the elements. That field acts as a demand-loaded, read-only reference to the object containing the collection. 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, and 'm' is the field name. Optional field "slot" sets the name the column containing the id of the containing object. This defaults to 'C_m_slot', where 'C' is the class of the containing object, and 'm' is the field name. The "C" in C_m and C_m_slot are passed through the schema normalisation function before being combined into a column name. 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::FromOne(3pm)
Man Page