ObjectDB - Lightweight Object-relational mapper
ObjectDB is a lightweight, deps free (except DBI of course) and flexible object-relational mapper.
Embedded SQL generator is similar to SQL::Abstract, but leaves low-level sql generation still possible.
Returns true when object was created or loaded. Otherwise false.
Returns true when object was modified (setting columns). Otherwise false.
Returns a new ObjectDB object.
Sets objects columns.
Used to define class schema. For more information see ObjectDB::Schema.
Returns object columns that are set or have a default value.
Gets and sets column value.
Object cloning. Everything is copied except primary key and unique key values.
Roll back transaction.
Creates a new object. Sets auto increment field to the last inserted id.
Loads object using primary key or unique key that was provided when creating a new instance. Dies if there was no primary or unique key.
Find objects. The second argument is a hashref that is translated into sql. Keys that can be used:
Build SQL. For more information see ObjectDB::SQL.
Prefetch related objects.
find returns array reference,
single to 1 undef or one object is returned (the first one).
page_size you can select specific pages without calculation limit and offset by yourself.
The size of the
It is 20 items by default.
Select only specific columns.
my $author = $article->related('author');
Gets prefetched related object(s).
Creates related objects.
Finds related objects.
find_objects but sets
Counts related objects.
Updates related objects. Use set key for setting new values.
Deletes related objects.
Creates and deletes related objects to satisfy the set. Usefull when setting many to many relationships.
Serializes object to hash. All prefetched objects are serialized also.
In alphabetical order:
Copyright (C) 2009, Viacheslav Tykhanovskyi.
This program is free software, you can redistribute it and/or modify it under the same terms as Perl 5.10.