Persistence::LOB - LOBs mapping object.


Persistence-Entity documentation  | view source Contained in the Persistence-Entity distribution.

Index


NAME

Top

Persistence::LOB - LOBs mapping object.

CLASS HIERARCHY

Top

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

SYNOPSIS

Top

    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

Top

Represents a base class for object relationship.

EXPORT

Top

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

Top

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

COPYRIGHT AND LICENSE

Top

AUTHOR

Top

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


Persistence-Entity documentation  | view source Contained in the Persistence-Entity distribution.