DBIx::Table::TestDataGenerator::SelfReference - self-reference handling
Determines if there is a self-reference and if so, information about it.
schema: DBIx schema of the target database
table: Name of the target table
Internal method, returns the name of the foreign key defining a self-reference and a hash relating the referencing to the referenced column in case there is a self-reference, returns undef otherwise.
If there is an fkey defining a self-reference, its name and the name of the referencing column are returned in a two-element array reference, otherwise undef is returned.
Arguments:
child_col: Name of the (unique) primary key column
parent_col: Name of the column referencing the primary key column
Returns a hash corresponding to the self-reference defined on the table.
Returns the number of roots in the target table in case a self-reference exists on it. A record is considered a root node if either the value for the parent primary key is equal to NULL or to the record's primary key value.
Jose Diaz Seng, <josediazseng at gmx.de>
<josediazseng at gmx.de>
Copyright (C) 2012-2013, Jose Diaz Seng.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl 5.10.0. For more details, see the full text of the licenses in the directory LICENSES.
This program is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose.
To install DBIx::Table::TestDataGenerator, copy and paste the appropriate command in to your terminal.
cpanm
cpanm DBIx::Table::TestDataGenerator
CPAN shell
perl -MCPAN -e shell install DBIx::Table::TestDataGenerator
For more information on module installation, please visit the detailed CPAN module installation guide.