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 to_one one_to_many many_to_many LAZY EAGER NONE ALL ON_INSERT ON_UPDATE ON_DELETE by 'all' tag
class name
entity name.
A map between database column and object attribute
Assocation to LOB objects definition.
Assocation to objects relationship definition.
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 });
Name of the class that is an adapter to meta object protocols. That class have to implements Persistence::Attribute interface.
Returns object creation method. Allowed values: bless or new
Cache for the attributes_to_columns method result
Cache for the columns_to_attributes method result
Cache for the columns_to_storage_attributes method result
Creates a meta entity class.
Returns meta enity class. Takes optionally package name as parameter.
Adds mapping between column name and related attribute. Takes column name and attribute object as parameter.
column ('column1' => has '$.attr1');
Adds mapping between lob column name and related attribute.
lob 'lob_column' => ( attribute => has('$.photo'), fetch_method => LAZY, );
Converts passed in data structure to attributes
Converts passed in data structure to lob attributes
Creates a meta attribute
Adds lob column. Takes lob column name, attribute name;
Deserialises resultset to object.
Returns join columns values for passed in relation
Return unique columns values
Return primary key values
Validates triggers types
Returns column name. Takes attribute name.
Transforms column values to the hash that can be blessed as an object. Takes hash ref of column_values
Transforms column values to the object attribute value hash. Takes hash ref of column_values
Transforms objects attributes to column values Takes object, optionally required columns. (by default all colunms)
Returns column values. Takes attribute values hash.
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.