José Diaz Seng > DBIx-Table-TestDataGenerator > DBIx::Table::TestDataGenerator::ForeignKey

Download:
DBIx-Table-TestDataGenerator-0.005.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
View/Report Bugs
Module Version: 0.005   Source  

NAME ^

DBIx::Table::TestDataGenerator::ForeignKey - foreign key constraint information

DESCRIPTION ^

This class serves to determine information about foreign keys defined on the target table.

SUBROUTINES/METHODS ^

schema

Accessor for the DBIx::Class schema for the target database, required constructor argument.

table

Accessor for target table, required constructor argument.

handle_self_ref_wanted

Accessor for flag telling if the user wants a self-reference to be handled, required constructor argument.

pkey_col

Accessor for name of the primary key column which should be incremented for the new records, required constructor argument.

pkey_col_names

Accessor for names of the primary key columns, required constructor argument.

roots_have_null_parent_id

Accessor for option controlling whether root nodes are identified by "parent pkey = NULL" or "parent pkey = pkey". If true, the first case holds.

fkey_cols

Accessor for a list of all names of columns involved in foreign key constraints, externally read-only.

fkey_tables_ref

Accessor for a reference to a hash having as keys the names of foreign key constraints and as values the names of the referenced tables, externally read-only.

fkey_self_ref

Accessor for the name of the foreign key being a self-reference if it exists, undef otherwise, externally read-only.

all_refcol_to_col_dict

Accessor for a reference to a hash where the keys are the names of the foreign keys and for each foreign key, the value is a hash reference having as keys the names of the referenced columns and as values the names of the referencing columns, externally read-only.

all_refcol_lists

Accessor for a reference to a hash where the keys are the names of the foreign keys and for each foreign key, the value is a reference to an array containing the column names of the referenced columns, externally read-only.

handle_self_ref

Accessor for a flag which is set to true only if the caller wants to handle a self-reference (i.e. if handle_self_ref_wanted is true) and it has been determined that a self-reference exists, externally read-only.

selfref_tree

Accessor for a reference to a hash where, assuming there is a self-reference, each keys is the id of a parent record and the corresponding value a reference to an array containing the list of client node ids. If no self-reference exists, the value is undef. This accessor is externally read-only.

root

Accessor for the root of the self-reference tree, taken directly from the Tree class.

parent_pkey_col

Accessor for the name of the column containing parent ids in case of a self-reference, undef otherwise, externally read-only.

BUILD

Arguments: none

Determines foreign key constraint information with the help of the other internal methods.

_fkey_name_to_source

Arguments: none

Internal method. Returns a hash where the keys are the names of the foreign keys on the target table and the values the names of the corresponding referenced tables.

_fkey_referenced_cols_to_referencing_cols

Arguments: none

Internal method. Returns a reference to a dictionary having as keys the fkey names and for each key as value a dictionary where the keys are the names of the referenced column names and the values the names of the corresponding referencing column names.

_fkey_referenced_cols

Arguments: none

Internal method. Returns a reference to a hash having the fkey names as keys and a comma-separated list of the column names of the referenced columns of the fkey as values.

AUTHOR ^

Jose Diaz Seng, <josediazseng at gmx.de>

COPYRIGHT AND LICENSE ^

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.

syntax highlighting: