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

NAME

Persistence::LOB - LOBs mapping object.

CLASS HIERARCHY

 Persistence::Fetchable
    |
    +----Persistence::LOB

SYNOPSIS

    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);

DESCRIPTION

Represents a base class for object relationship.

EXPORT

LAZY EAGER NONE ALL ON_INSERT ON_UPDATE ON_DELETE method by ':all' tag.

ATTRIBUTES

attribute
orm
initialise
install_fetch_interceptor
deserialise_attribute

Deserializes attribute value.

SEE ALSO

Persistence::Relationship Persistence::Entity Persistence::Entity::Manager Persistence::ORM

COPYRIGHT AND LICENSE

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.

AUTHOR

Adrian Witas, <adrian@webapp.strefa.pl</gt>