The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

blx::xsdsql::schema_repository::sql::generic::table - a generic table class

SYNOPSIS

use blx::xsdsql::schema_repository::sql::generic::table

DESCRIPTION

this package is a class - instance it with the method new

VERSION

0.10.0

FUNCTIONS

this module defined the followed functions

new - constructor -

        the construct is private, use the new constructor of a child class

_new - contructor

    PARAMS:
        CATALOG_NAME             - catalog of table
        SCHEMA_CODE          - schema code of table
        XSD_SEQ              - a XSD_SEQ start number
        XSD_TYPE             - xsd type - see XSD_TYPE_* constants
        CHOICE               - the table is associated to a choice
        MINOCCURS            - the table as a minoccurs
        MAXOCCURS            - the table as a maxoccurs
        PATH                 - a node path name
        TYPE                 - an internal node type
        NAME                 - a node name
        DEEP_LEVEL           - a deep level - the root has level 0
        INTERNAL_REFERENCE   - if true the table is an occurs of simple types
        MIXED                - is true if  the xsd:mixed attribute is true
        URI                  - a node URI
        VIEW_SQL_NAME        - the corresponding view name
        DEBUG                - set the debug mode
        TAG                  - set the caller for debug

get_columns - return an array of columns object

get_child_tables - return an array of child tables

get_sql_name - return the sql name

get_constraint_name - return a constraint name

    the first argument must be the constant 'pk' (primary key)

get_pk_columns - return the primary key columns

is_type - return true if the table is associated to a xsd type

is_simple_type - return true if the table is associated to a xsd simple type

is_complex_type - return true if the table is associated to a xsd complex type

is_simple_content_type - return true if the table is associated to a xsd simple content type

is_group_type - return true if the table is associated to a xsd group type

is_choice - return true if the table is associated to a xsd choice

is_internal_reference - return true if the the table is an occurs of simple types

is_unpath - return true if the table is not associated to a path

get_xsd_seq - return the start xsd sequence

get_xsd_type - return the xsd type og the object - see the constants XSD_TYPE_*

get_min_occurs - return the min occurs of the table

get_max_occurs - return the max occurs of the table

get_path - return the xml path associated with table

get_name - return the table name

get_dictionary_data - return an hash of dictionary column name => value for the insert into dictionary

    the first argument must be:
        TABLE_DICTIONARY - return data for table dictionary
        RELATION_DICTIONARY - return data for relation dictionary
        COLUMN_DICTIONARY - return data for column dictionary

get_deep_level - return the deep level - the root has level 0

get_parent_path - return the parent path if is_unpath is true

inc_xsd_seq - increment by 1 the value of attribute XSD_SEQ

add_columns

    the arguments are a flag or columns
        value for flag is
                IGNORE_ALREADY_EXIST         - not add a column if the name is already exist in table otherwise is an error
                ACCEPT_DUPLICATE_PATH        - add the column if the path is already registered in table otherwise is an error
                NO_GENERATE_SEQUENCE        - not set the column sequence in columns
                NO_SET_TABLE_NAME             - not set the table name in columns
                NO_GENERATE_SQL_NAME        - not geneate colum sql name

reset_columns - reset the columns of the table

add_child_tables

   the arguments are tables

delete_child_tables - delete child tables

    the arguments are the positions index of the child tables

find_column_by_name - find a column

    the 1^ param is the name (not the sql name) of the column

    if the column exist return a column object otherwise undef

EXPORT

None by default.

EXPORT_OK

none

SEE ALSO

See blx::xsdsql::schema_repository::sql::generic::catalog, it's the base class

See blx:.xsdsql::generator for generate the schema of the database and blx::xsdsql::xsd_parser for parse a xsd file (schema file)

AUTHOR

lorenzo.bellotti, <pauseblx@gmail.com>

COPYRIGHT

Copyright (C) 2010 by lorenzo.bellotti

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

See http://www.perl.com/perl/misc/Artistic.html