DBIx-DBStag
view release on metacpan or search on metacpan
DBIx/DBStag.pm view on Meta::CPAN
my $v = $tnode->data;
# -- CHECK FOR MACRO EXPANSION (XORT-STYLE) --
# IF this tnode was originally an ntnode that
# was collapsed to a pk val, xort style, do not
# try and map it to a previously assigned macro
# EXAMPLE:
# we start with <foo_id><bar><key>A</></></>
# we collapse too <foo_id>$v</>
if ($assigned_node_h{$tnode->name}) {
trace(0, "ALREADY CALCULATED; not a Macro ID:$v;; in $element/".$tnode->name) if $TRACE;
# DO NOTHING
}
else { # NOT ASSIGNED
my $actual_id =
$self->macro_id_h->{$v};
if (!defined($actual_id)) {
$self->throw("XORT-style Macro ID:$v is undefined;; in $element/".$tnode->name);
}
$tnode->data($actual_id);
}
# -- END OF MACRO EXPANSION --
}
elsif ($tnode->name eq $pkcol) {
my $v = $tnode->data;
trace(0, "REMAP $pkcol: $v => ? [do not know new value yet]") if $TRACE;
$remap{$tnode->name} = $v; # map after insert/update
$node->unset($tnode->name); # discard placeholder
DBIx/DBStag.pm view on Meta::CPAN
XML node
=item delete NOT IMPLEMENTED
deletes row that has matching UC
=back
Operations can be used in either XORT or Stag mode
=head3 Macros
Macros can be used with either XORT or Stag style mappings. Macros
allow you to refer to the same node later on in the XML
<person op="lookup" id="joe">
<name>joe</name>
</person>
<person op="lookup" id="fred">
<name>fred</name>
</person>
...
<person_relationship>
DBIx/DBStag.pm view on Meta::CPAN
AUTO_INCREMENT) in MySQL. They are identifiers assigned automatically
be the database with no semantics.
It may be desirable to store the same data in two different
databases. We would generally not expect the surrogate IDs to match
between databases, even if the rest of the data does.
(If you do not use surrogate primary key columns in your load xml,
then you can ignore this accessor)
You should NOT use this method in conjunction with Macros
If you use primary key columns in your XML, and the primary keys are
not surrogate, then youshould set this. If this accessor is set to
non-zero (true) then the primary key values in the XML will be used.
If your db has surrogate/auto-increment/serial PKs, and you wish to
use these PK columns in your XML, yet you want to make XML that can be
exported from one db and imported into another, then the default
behaviour will be fine.
( run in 0.511 second using v1.01-cache-2.11-cpan-bbe5e583499 )