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

Name

Object::Relation::Meta::DataTypes - Object::Relation data type definition

Synopsis

  package Object::Relation::Foo;
  use Object::Relation;

  meta 'foo';
  has bar => ( type => 'bool' );
  build;

Description

This module handles the definition of fundamental data types used by TKP. As these data types are loaded by TKP and are always available for use, this module should never be used directly. Other data types may be loaded from the modules in the Object::Relation::DataType name space. Classes that inherit from Object::Relation::Base and are defined by Object::Relation::Meta are also available as data types, referenceable by their key names.

Consult Object::Relation::Meta and Class::Meta for details on creating new Object::Relation classes with attributes of the types defined by this module.

Data Types

The Data types defined by this module are:

uuid

A globally unique identifier as generated by Data::UUID.

string

A Perl string, decoded to its internal, utf8 format.

integer
int

An integer. Throws a Fatal::Invalid exception if the value is not a whole number.

whole

A whole number, which is to say any integer greater than or equal to 0. Throws a Fatal::Invalid exception if the value is not a whole number.

posint

A positive integer. Throws a Fatal::Invalid exception if the value is not a posint number.

bool

A boolean value.

binary

Binary data. Attributes of this type should be used to store relatively small quantities of binary data, such as small Web images and the like. Larger quantities of binary data should be stored in blob attributes (TBD).

version

A version object.

operator

Operator strings. Allowable operators are:

==
>
<
>=
<=
!=
eq
ne
gt
lt
ge
le
=~
!~
attribute

Object::Relation::Meta::Attribute objects.

gtin

A GTIN code, which includes UPC-A and EAN codes. Some examples:

  036000291452
  0036000291452
  725272730706
  0978020137962
  4007630000116

Validity of a GTIN is calculated by the isa_gtin() function imported from Object::Relation::Functions.

Copyright and License

Copyright (c) 2004-2006 Kineticode, Inc. <info@obj_relode.com>

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.