IIRC SQLMaps do not do Object-Relational mappings as it's generally understood. For a reasonably good O/R mapping (in the usual sense) in perl see Class::DBI.

As I understand it, SQL maps merely transforms the results of a hand-written SQL query as an object with some getter/setter methods. You can get the same kind of functionality by doing something like

my $data = $sth->fetchrow_hashref(); my $object = bless $data,Some::Class; package Some::Class; use base 'Class::Accessor'; __PACKAGE__->mk_accessors(qw(result_column_a result_column_b .... );

THe only other thing SQLMaps does is that it allows you to take the SQL code out of the java code (which means you can, and probably should, rewrite the SQL for every database you want to support)

I'm not trying to take the piss out of SQLMaps; Java just forces you to make all of this really difficult. I'm not sure if there is an equivalent module for Perl at the moment. I would like one, as long as it didn't require me to configure it in XML.


In reply to Re: SQLMaps by Joost
in thread SQLMaps by sigzero

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.