1 package SQL::Translator::Schema::Graph::Node;
5 use Class::MakeMethods::Template::Hash (
7 'array_of_objects -class SQL::Translator::Schema::Graph::Edge' => [ qw( edges ) ],
8 'array_of_objects -class SQL::Translator::Schema::Graph::CompoundEdge' => [ qw( compoundedges ) ],
9 'array_of_objects -class SQL::Translator::Schema::Graph::HyperEdge' => [ qw( hyperedges ) ],
10 #'hash' => [ qw( many via has edgecount data_fields) ],
11 #'hash' => [ qw( many via has data_fields) ],
12 scalar => [ qw( base name order primary_key primary_key_accessor table is_trivial_link ) ],
13 number => [ qw( order ) ],
19 $self->{_many} ||= {};
23 return $self->{_many}{$k};
27 foreach my $k (keys %arg){
28 #warn $a,"\t",$arg{$k};
29 $self->{_many}{$k} = $arg{$k};
34 return $self->{_many};
45 return $self->{_via}{$k};
49 foreach my $k (keys %arg){
50 #warn $a,"\t",$arg{$k};
51 $self->{_via}{$k} = $arg{$k};
67 return $self->{_has}{$k};
71 foreach my $k (keys %arg){
72 #warn $a,"\t",$arg{$k};
73 $self->{_has}{$k} = $arg{$k};
85 $self->{_edgecount} ||= {};
89 return $self->{_edgecount}{$k};
93 foreach my $k (keys %arg){
94 #warn $a,"\t",$arg{$k};
95 $self->{_edgecount}{$k} = $arg{$k};
100 return $self->{_edgecount};
107 $self->{_data_fields} ||= {};
111 return $self->{_data_fields}{$k};
115 foreach my $k (keys %arg){
116 #warn $a,"\t",$arg{$k};
117 $self->{_data_fields}{$k} = $arg{$k};
122 return $self->{_data_fields};