| Tree-Persist documentation | view source | Contained in the Tree-Persist distribution. |
Tree::Persist::DB::SelfReferential - a handler for Tree persistence
Please see Tree::Persist for how to use this module.
This module is a plugin for Tree::Persist to store a Tree to a self-referential DB table. This is where a table contains an id column for the row and a parent_id column that refers back to another row's id (which is the parent row).
This is the simplest way to store a tree datastructure in a database, but it has performance penalties.
In addition to any parameters required by its parent Tree::Persist::DB, the following parameters are required by connect():
This is the id for the root node of the tree. By specifying this, you can both store more that one tree in a table as well as only load a subtree.
This is the column name for the id field. It defaults to "id".
This is the column name for the parent_id field. It defaults to "parent_id".
This is the column name for the value field. It defaults to "value".
This is the column name for the class field. If unset, the class parameter will be used.
Please see the relevant section of Tree::Persist.
Please see the relevant section of Tree::Persist.
Rob Kinyon <rob.kinyon@iinteractive.com>
Stevan Little <stevan.little@iinteractive.com>
Thanks to Infinity Interactive for generously donating our time.
Copyright 2004, 2005 by Infinity Interactive, Inc.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
| Tree-Persist documentation | view source | Contained in the Tree-Persist distribution. |