Persistence::ORM - Object-relational mapping.
package Employee; use Abstract::Meta::Class ':all'; use Persistence::ORM ':all'; entity 'emp'; column empno => has('$.no') ; column ename => has('$.name');
Object-relational mapping module.
entity, column, trigger by 'all' tag
class name
entity name.
Columns map between database column and object attribute
Defines tigger that will execute on one of the following event before_insert after_insert before_update after_update before_delete after_delete, on_fetch Takes event name as first parameter, and callback as secound parameter.
$entity_manager->trigger(before_insert => sub { my ($self) = @_; #do stuff });
Creates a meta entity class.
Adds mapping between column name and related attribute. column (column => has '$.attr1');
Returns meta enity class. Takes optionally package name as parameter.
Checks if attributes mapped from column are unlbessed hash structure, if they are then dynamicly adds them Abstract::Meta::Attribute to Abstract::Meta::Class
Adds columns. Takes column name, attribute name;
Deserialises resultset to object.
Transform source hash to the object hash. Return hash where source key is mapped attribute storage key. Takes hash ref of field values.
Maps keys on passed in hash to coresponding columns. Takes object as parameter.
Transform objects attirubtes to column values
Serialised retrives date to object.
Maps keys from passed in hash to coresponding columns.
Returns join columns values for passed in relation
Return unique columns values
Return primary key values
Validates triggers types
Abstract::Meta::Class Persistence::Entity::Manager SQL::Entity
The SQL::Entity::ORM module is free software. You may distribute under the terms of either the GNU General Public License or the Artistic License, as specified in the Perl README file.
Adrian Witas, adrian@webapp.strefa.pl
To install Persistence::Entity, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Persistence::Entity
CPAN shell
perl -MCPAN -e shell install Persistence::Entity
For more information on module installation, please visit the detailed CPAN module installation guide.