Persistence::LOB - LOBs mapping object.
Persistence::Fetchable | +----Persistence::LOB
use Persistence::ORM':all'; use Persistence::Entity ':all'; my $photo_entity = Persistence::Entity->new( name => 'photo', alias => 'ph', primary_key => ['id'], columns => [ sql_column(name => 'id'), sql_column(name => 'name', unique => 1), ], lobs => [ sql_lob(name => 'blob_content', size_column => 'doc_size'), ] ); $entity_manager->add_entities($photo_entity); package Photo; use Abstract::Meta::Class ':all'; use Persistence::ORM ':all'; entity 'photo'; column 'id' => has('$.id'); column 'name' => has('$.name'); lob 'blob_content' => (attribute => has('$.image'), fetch_method => LAZY); package EagerPhoto; use Abstract::Meta::Class ':all'; use Persistence::ORM ':all'; entity 'photo'; column 'id' => has('$.id'); column 'name' => has('$.name'); lob 'blob_content' => (attribute => has('$.image'), fetch_method => EAGER); my ($photo) = $entity_manager->find(photo => 'Photo', id => 10); $photo->name('Moon'); $photo->set_image($moon_image); $entity_manager->update($photo);
Represents a base class for object relationship.
LAZY EAGER NONE ALL ON_INSERT ON_UPDATE ON_DELETE method by ':all' tag.
Deserializes attribute value.
Persistence::Relationship Persistence::Entity Persistence::Entity::Manager Persistence::ORM
The Persistence::LOB 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</gt>
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.