« blib/lib/blx/xsdsql/schema_repository/sql/DBM/table.pm
↑ Summary
blib/lib/blx/xsdsql/schema_repository/sql/generic/relation_table.pm »
| 1 | package blx::xsdsql::schema_repository::sql::generic::relation_schema; | ||
| 2 | |||
| 3 | use strict; # use strict is for PBP | ||
| 4 | use Filter::Include; | ||
| 5 | include blx::xsdsql::include; | ||
| 6 | #line 7 | ||
| 7 | |||
| 8 | |||
| 9 | my @ATTRIBUTE_KEYS:Constant( | ||
| 10 | qw( | ||
| 11 | CATALOG_NAME | ||
| 12 | PARENT_SCHEMA_CODE | ||
| 13 | CHILD_SEQUENCE | ||
| 14 | CHILD_SCHEMA_CODE | ||
| 15 | PARENT_NAMESPACE | ||
| 16 | CHILD_LOCATION | ||
| 17 | ) | ||
| 18 | ); | ||
| 19 | |||
| 20 | our %_ATTRS_R:Constant(()); | ||
| 21 | our %_ATTRS_W:Constant(()); | ||
| 22 | |||
| 23 | sub _get_attrs_w { return \%_ATTRS_W; } | ||
| 24 | sub _get_attrs_r { return \%_ATTRS_R; } | ||
| 25 | |||
| 26 | |||
| 27 | use blx::xsdsql::ut::ut qw(nvl ev); | ||
| 28 | use base qw(blx::xsdsql::ut::common_interfaces); | ||
| 29 | |||
| 30 | sub new { | ||
| 31 | my ($class,%params)=@_; | ||
| 32 | return bless \%params,$class; | ||
| 33 | } | ||
| 34 | |||
| 35 | sub factory_from_dictionary_data { | ||
| 36 | my ($data,%params)=@_; | ||
| 37 | affirm { ref($data) eq 'ARRAY' } "the 1^ param must be array"; | ||
| 38 | affirm { defined $params{EXTRA_TABLES} } " the param EXTRA_TABLES must be set"; | ||
| 39 | affirm { scalar(@$data) == scalar(@ATTRIBUTE_KEYS) } "the attributes number is not equal to keys number"; | ||
| 40 | my %data=map { ($ATTRIBUTE_KEYS[$_],$data->[$_]) } (0..scalar(@$data) - 1); | ||
| 41 | my $t=__PACKAGE__->new(%data); | ||
| 42 | return $t; | ||
| 43 | } | ||
| 44 | |||
| 45 | |||
| 46 | 1; | ||
| 47 | |||
| 48 | __END__ |