<HTML >
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=us-ascii">



<META content="MSHTML 6.00.6000.16788" name=GENERATOR></HEAD>
<BODY >
<DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff 
size=2></FONT>&nbsp;</DIV>
<DIV>
<DIV style="COLOR: black; FONT-FAMILY: arial"><SPAN 
style="FONT-WEIGHT: normal; FONT-SIZE: 7.5pt"><SPAN 
class=418402109-22012009><FONT size=2>Hi Oleg, </FONT></SPAN></SPAN></DIV>
<DIV style="COLOR: black; FONT-FAMILY: arial"><SPAN 
style="FONT-WEIGHT: normal; FONT-SIZE: 7.5pt"><SPAN 
class=418402109-22012009><FONT size=2>Thanks for your advice. I've tried this 
and it might be the way to go for me. Id prefer to be able to have a resultset 
object for the subclasses as well so that I can do $rs = 
$schema-&gt;resultset('ClassA')-&gt;new(...);</FONT></SPAN></SPAN></DIV>
<DIV style="COLOR: black; FONT-FAMILY: arial"><SPAN 
style="FONT-WEIGHT: normal; FONT-SIZE: 7.5pt"><SPAN 
class=418402109-22012009><FONT size=2></FONT></SPAN></SPAN>&nbsp;</DIV>
<DIV style="COLOR: black; FONT-FAMILY: arial"><SPAN 
style="FONT-WEIGHT: normal; FONT-SIZE: 7.5pt"><SPAN 
class=418402109-22012009><FONT size=2>That way it would ensure that the only the 
correct columns were available when creating a new row for 
classA.</FONT></SPAN></SPAN></DIV>
<DIV style="COLOR: black; FONT-FAMILY: arial"><SPAN 
style="FONT-WEIGHT: normal; FONT-SIZE: 7.5pt"><SPAN 
class=418402109-22012009><FONT size=2></FONT></SPAN></SPAN>&nbsp;</DIV>
<DIV style="COLOR: black; FONT-FAMILY: arial"><SPAN 
style="FONT-WEIGHT: normal; FONT-SIZE: 7.5pt"><SPAN 
class=418402109-22012009><FONT size=2>I would also be able to search on the 
subclass columns - why the need to use frozen columns, why cant you just use 
add_columns to add extra cols to the&nbsp;already defined&nbsp;baseclass ones 
for the subclass? Maybe this comes down to having just one result_source under 
the hood.</FONT></SPAN></SPAN></DIV>
<DIV style="COLOR: black; FONT-FAMILY: arial"><SPAN 
style="FONT-WEIGHT: normal; FONT-SIZE: 7.5pt"><SPAN 
class=418402109-22012009><FONT size=2></FONT></SPAN></SPAN>&nbsp;</DIV>
<DIV style="COLOR: black; FONT-FAMILY: arial"><SPAN 
style="FONT-WEIGHT: normal; FONT-SIZE: 7.5pt"><SPAN 
class=418402109-22012009><FONT size=2>I have managed via a custom resultset 
object to use set proxy methods at row creation by intercepting the new_result 
method.</FONT></SPAN></SPAN></DIV>
<DIV style="COLOR: black; FONT-FAMILY: arial"><SPAN 
style="FONT-WEIGHT: normal; FONT-SIZE: 7.5pt"><SPAN 
class=418402109-22012009><FONT size=2></FONT></SPAN></SPAN>&nbsp;</DIV>
<DIV style="COLOR: black; FONT-FAMILY: arial"><SPAN 
style="FONT-WEIGHT: normal; FONT-SIZE: 7.5pt"><SPAN 
class=418402109-22012009><FONT size=2>sub new_result 
{</FONT></SPAN></SPAN></DIV>
<DIV style="COLOR: black; FONT-FAMILY: arial"><SPAN 
style="FONT-WEIGHT: normal; FONT-SIZE: 7.5pt"><SPAN 
class=418402109-22012009><FONT size=2>&nbsp; my ($self,@args) = 
@_;</FONT></SPAN></SPAN></DIV>
<DIV style="COLOR: black; FONT-FAMILY: arial"><SPAN 
style="FONT-WEIGHT: normal; FONT-SIZE: 7.5pt"><SPAN 
class=418402109-22012009><FONT size=2></FONT></SPAN></SPAN>&nbsp;</DIV>
<DIV style="COLOR: black; FONT-FAMILY: arial"><SPAN 
style="FONT-WEIGHT: normal; FONT-SIZE: 7.5pt"><SPAN 
class=418402109-22012009><FONT size=2>&nbsp; #get actual cols for the 
table</FONT></SPAN></SPAN></DIV>
<DIV style="COLOR: black; FONT-FAMILY: arial"><SPAN 
style="FONT-WEIGHT: normal; FONT-SIZE: 7.5pt"><SPAN 
class=418402109-22012009><FONT size=2>&nbsp; my @cols = 
$self-&gt;result_source-&gt;columns;</FONT></SPAN></SPAN></DIV>
<DIV style="COLOR: black; FONT-FAMILY: arial"><SPAN 
style="FONT-WEIGHT: normal; FONT-SIZE: 7.5pt"><SPAN 
class=418402109-22012009><FONT size=2></FONT></SPAN></SPAN>&nbsp;</DIV>
<DIV style="COLOR: black; FONT-FAMILY: arial"><SPAN 
style="FONT-WEIGHT: normal; FONT-SIZE: 7.5pt"><SPAN 
class=418402109-22012009><FONT size=2><FONT color=#0000ff>&nbsp; # look for 
provided args that are not in table</FONT></FONT></SPAN></SPAN></DIV>
<DIV style="COLOR: black; FONT-FAMILY: arial"><SPAN 
style="FONT-WEIGHT: normal; FONT-SIZE: 7.5pt"><SPAN 
class=418402109-22012009><FONT size=2><FONT color=#0000ff>&nbsp; # assume they 
are proxied args</FONT>&nbsp; </FONT></SPAN></SPAN></DIV>
<DIV style="COLOR: black; FONT-FAMILY: arial"><SPAN 
style="FONT-WEIGHT: normal; FONT-SIZE: 7.5pt"><SPAN 
class=418402109-22012009><FONT size=2>&nbsp; my 
%proxyArgs;</FONT></SPAN></SPAN></DIV>
<DIV style="COLOR: black; FONT-FAMILY: arial"><FONT size=2><SPAN 
style="FONT-WEIGHT: normal; FONT-SIZE: 7.5pt"><SPAN 
class=418402109-22012009>&nbsp;&nbsp;&nbsp;foreach my $k (keys %{$args[0]}) 
{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
if (!grep /$k/, @cols) 
{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;$proxyArgs{$k} = delete 
$args[0]{$k};<BR></SPAN></SPAN><SPAN 
style="FONT-WEIGHT: normal; FONT-SIZE: 7.5pt"><SPAN 
class=418402109-22012009>&nbsp;&nbsp;&nbsp; &nbsp;}</SPAN></SPAN></FONT></DIV>
<DIV style="COLOR: black; FONT-FAMILY: arial"><SPAN 
style="FONT-WEIGHT: normal; FONT-SIZE: 7.5pt"><SPAN 
class=418402109-22012009><FONT size=2>&nbsp; }</FONT></SPAN></SPAN></DIV>
<DIV style="COLOR: black; FONT-FAMILY: arial"><SPAN 
style="FONT-WEIGHT: normal; FONT-SIZE: 7.5pt"><SPAN 
class=418402109-22012009><FONT size=2>&nbsp; # create new 
row</FONT></SPAN></SPAN></DIV>
<DIV style="COLOR: black; FONT-FAMILY: arial"><SPAN 
style="FONT-WEIGHT: normal; FONT-SIZE: 7.5pt"><SPAN 
class=418402109-22012009><FONT size=2>&nbsp; my $row = 
$self-&gt;next::method(@args);</FONT></SPAN></SPAN></DIV>
<DIV style="COLOR: black; FONT-FAMILY: arial"><SPAN 
style="FONT-WEIGHT: normal; FONT-SIZE: 7.5pt"><SPAN 
class=418402109-22012009><FONT size=2></FONT></SPAN></SPAN>&nbsp;</DIV>
<DIV style="COLOR: black; FONT-FAMILY: arial"><SPAN 
style="FONT-WEIGHT: normal; FONT-SIZE: 7.5pt"><SPAN 
class=418402109-22012009><FONT size=2>&nbsp; # set proxied 
args</FONT></SPAN></SPAN></DIV>
<DIV style="COLOR: black; FONT-FAMILY: arial"><SPAN 
style="FONT-WEIGHT: normal; FONT-SIZE: 7.5pt"><SPAN 
class=418402109-22012009><FONT size=2>&nbsp; foreach my $k (keys %proxyArgs) 
{</FONT></SPAN></SPAN></DIV>
<DIV style="COLOR: black; FONT-FAMILY: arial"><SPAN 
style="FONT-WEIGHT: normal; FONT-SIZE: 7.5pt"><SPAN 
class=418402109-22012009><FONT size=2>&nbsp;&nbsp;&nbsp; 
$row-&gt;$k($proxyArgs{$k});</FONT></SPAN></SPAN></DIV>
<DIV style="COLOR: black; FONT-FAMILY: arial"><SPAN 
style="FONT-WEIGHT: normal; FONT-SIZE: 7.5pt"><SPAN 
class=418402109-22012009><FONT size=2>&nbsp; }</FONT></SPAN></SPAN></DIV>
<DIV style="COLOR: black; FONT-FAMILY: arial"><SPAN 
style="FONT-WEIGHT: normal; FONT-SIZE: 7.5pt"><SPAN 
class=418402109-22012009><FONT size=2>}</FONT></SPAN></SPAN></DIV>
<DIV style="COLOR: black; FONT-FAMILY: arial"><SPAN 
style="FONT-WEIGHT: normal; FONT-SIZE: 7.5pt"><SPAN 
class=418402109-22012009><FONT size=2></FONT></SPAN></SPAN>&nbsp;</DIV>
<DIV style="COLOR: black; FONT-FAMILY: arial"><SPAN 
style="FONT-WEIGHT: normal; FONT-SIZE: 7.5pt"><SPAN 
class=418402109-22012009><FONT size=2></FONT></SPAN></SPAN>&nbsp;</DIV>
<DIV style="COLOR: black; FONT-FAMILY: arial"><SPAN 
style="FONT-WEIGHT: normal; FONT-SIZE: 7.5pt"><SPAN 
class=418402109-22012009><FONT size=2>with this in place, I can now 
do:</FONT></SPAN></SPAN></DIV>
<DIV style="COLOR: black; FONT-FAMILY: arial"><SPAN 
style="FONT-WEIGHT: normal; FONT-SIZE: 7.5pt"><SPAN 
class=418402109-22012009><FONT size=2></FONT></SPAN></SPAN>&nbsp;</DIV>
<DIV style="COLOR: black; FONT-FAMILY: arial"><SPAN 
style="FONT-WEIGHT: normal; FONT-SIZE: 7.5pt"><SPAN 
class=418402109-22012009><FONT 
size=2>$schema-&gt;resultset('SubClass')-&gt;create( subClassCol1=&gt; 'xxx', 
subClassCol2=&gt;'yyy', baseClassCol=&gt; 'zzz');</FONT></SPAN></SPAN></DIV>
<DIV style="COLOR: black; FONT-FAMILY: arial"><SPAN 
style="FONT-WEIGHT: normal; FONT-SIZE: 7.5pt"><SPAN 
class=418402109-22012009><FONT size=2></FONT></SPAN></SPAN>&nbsp;</DIV>
<DIV style="COLOR: black; FONT-FAMILY: arial"><SPAN 
style="FONT-WEIGHT: normal; FONT-SIZE: 7.5pt"><SPAN 
class=418402109-22012009><FONT size=2>The subClassCol1 and subClassCol2 live in 
the sub class's table and the baseClassCol lives in the base class's 
Table.</FONT></SPAN></SPAN></DIV>
<DIV style="COLOR: black; FONT-FAMILY: arial"><SPAN 
style="FONT-WEIGHT: normal; FONT-SIZE: 7.5pt"><SPAN 
class=418402109-22012009><FONT size=2>By this&nbsp;method I also ensure that a 
base class row exists for every sub class.</FONT></SPAN></SPAN></DIV>
<DIV style="COLOR: black; FONT-FAMILY: arial"><SPAN 
style="FONT-WEIGHT: normal; FONT-SIZE: 7.5pt"><SPAN 
class=418402109-22012009><FONT size=2></FONT></SPAN></SPAN>&nbsp;</DIV>
<DIV style="COLOR: black; FONT-FAMILY: arial"><SPAN 
style="FONT-WEIGHT: normal; FONT-SIZE: 7.5pt"><SPAN 
class=418402109-22012009><FONT size=2>I need to experiment more, but this should 
allow me to have Subclass and baseclass resultsets, both searchable on all 
columns. Just need to ensure I can get the relationships correct to my other 
objects.</FONT></SPAN></SPAN></DIV>
<DIV style="COLOR: black; FONT-FAMILY: arial"><SPAN 
style="FONT-WEIGHT: normal; FONT-SIZE: 7.5pt"><SPAN 
class=418402109-22012009><FONT 
size=2></FONT></SPAN></SPAN>&nbsp;</DIV></DIV><BR>
<BLOCKQUOTE 
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
  <DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
  <HR tabIndex=-1>
  <FONT face=Tahoma size=2><B>From:</B> Oleg Pronin [mailto:syber.rus@gmail.com] 
  <BR><B>Sent:</B> 22 January 2009 01:40<BR><B>To:</B> DBIx::Class user and 
  developer list<BR><B>Subject:</B> Re: [Dbix-class] RE: Inheritance 
  question..<BR></FONT><BR></DIV>
  <DIV></DIV>1) DBIx::Class::DynamicSubclass will automaticaly subclass your row 
  object when<BR>&nbsp;&nbsp;&nbsp;&nbsp; a) fetched from 
  DB<BR>&nbsp;&nbsp;&nbsp;&nbsp; b) created (-&gt;new or 
  -&gt;create)<BR>&nbsp;&nbsp;&nbsp;&nbsp; c) changed subclassing column 
  <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; For example when type = 
  null row is BaseClass, when type = 1 row is ClassA, when 2 row is 
  ClassB.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; my $row = 
  $rs-&gt;new({type =&gt; 1}); # $row is 
  ClassA<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $row-&gt;type(2); 
  #$row is ClassB<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  $row-&gt;type(undef); #$row is BaseClass<BR><BR>2) You can set up dynamic 
  columns with subclassing if you use DBIx::Class::DynamicSubclass + 
  DBIx::Class::FrozenColumns. But there is caveat: you will not be able to use 
  'frozen' columns in WHERE clause in SQL.<BR>&nbsp;&nbsp;&nbsp; The idea 
  is:<BR><BR>&nbsp; &nbsp; &nbsp; package 
  BaseClass;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  -&gt;load_components(qw/DynamicSubclass FrozenColumns 
  Core/);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  -&gt;add_columns(qw/all_columns_that_are_common_to_all_subclasses + type + 
  data/);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #data must be of type blob or text 
  (depends on storage engine)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  -&gt;typecast_map(type =&gt; {1 =&gt; 'ClassA', 2 =&gt; 
  'ClassB'});<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; package 
  ClassA;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; use parent 
  'BaseClass';<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  -&gt;add_frozen|dumped|json_columns(data =&gt; 
  qw/all_columns_that_are_specific_to_ClassA &nbsp;&nbsp; 
  for_example/);<BR>&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; package 
  MyCode;<BR><BR>&nbsp; &nbsp; &nbsp; my $row = $rs-&gt;create({type =&gt; 
  1});<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $row-&gt;for_example('hello'); 
  #ok<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  $row-&gt;type(2);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  $row-&gt;for_example('hello'); # error<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  $rs-&gt;new({ type=&gt; 1, for_example =&gt; 'hello' }); #that's ok 
  too<BR><BR>This is not ideal mechanism, but it quite useful and it helps me 
  many times.<BR>&nbsp; <BR><BR>
  <DIV class=gmail_quote>2009/1/21 Howe, Tom (IDEAS PRACTICE AREAS) <SPAN 
  dir=ltr>&lt;<A 
  href="mailto:Tom.Howe@morganstanley.com">Tom.Howe@morganstanley.com</A>&gt;</SPAN><BR>
  <BLOCKQUOTE class=gmail_quote 
  style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">Further 
    to my question on inheritance, I have been trying subclassing and the proxy 
    method options and have a couple of other questions.<BR><BR><BR>First, in an 
    attempt to try the single flattened style where all Foo object reside in one 
    table, I tried the cookbook entry on "Dynamic Sub-classing DBIx::Class proxy 
    classes".<BR><BR>I set up a db table called foo, created a Foo class with an 
    inflate_result() method and a Foo::Noisy class that inherited from the Foo 
    class.<BR><BR>I can now create the Foo object and have it inflate into a 
    Foo::Noisy class.<BR><BR>But, I cant get a Foo::Noisy resultset.<BR><BR>I 
    thought maybe I could define Foo with only the common columns, then create a 
    Foo::Noisy subclass that would inherit the columns of Foo and then I could 
    create a default value for 'type' and use add_columns() to define the 
    additional NoisyFoo column 'decibels'.<BR><BR>But it seems the only 
    resultset I can get is for Foo. So anyone creating objects could 
    inadvertently set a 'colour' for a NoisyFoo or a 'decibel' for 
    ColouredFoo.<BR><BR><BR><BR><BR><BR>The second thing I tried was to create 3 
    separate tables for Foo, NoisyFoo and ColouredFoo. Then I created a 
    Foo::Noisy class with a has_one relationship to the Foo class using a 
    proxy=&gt;[] defined to allow transparent setting/getting of the 
    'name'.<BR><BR>This works to a degree in that I can do :<BR><BR>my $nf = 
    $schema-&gt;resultset('Foo::Noisy')-&gt;create({id=&gt;1, 
    decibels=&gt;110});<BR>$nf-&gt;name('mynoisyfoo');<BR><BR>But it fails if I 
    try to do:<BR>my $nf = 
    $schema-&gt;resultset('Foo::Noisy')-&gt;create({id=&gt;1, decibels=&gt;110, 
    name=&gt;'noisyfoo'});<BR><BR>Giving the 
    error:<BR>DBIx::Class::ResultSet::create(): No such column name on 
    DB::Foo::Noisy<BR><BR>The proxy doesn't seem to be in affect during 
    creation.<BR><BR>Also, if I *don't* set the name, I don't get a row in the 
    Foo table.<BR>Is there a way to enforce that the row is 
    created?<BR><BR>Otherwise, if I want to search for all Foos, I cant do it on 
    the common table.<BR><BR>Is there anyway to ensure the Foo row is created 
    and grn can be passed on create?<BR>
    <DIV>
    <DIV></DIV>
    <DIV class=Wj3C7c><BR><BR><BR><BR><BR>&gt; -----Original 
    Message-----<BR>&gt; From: Howe, Tom (IDEAS PRACTICE AREAS)<BR>&gt; Sent: 21 
    January 2009 09:42<BR>&gt; To: DBIx::Class user and developer list<BR>&gt; 
    Subject: [Dbix-class] Inheritance question..<BR>&gt;<BR>&gt; Class structure 
    is something like this..<BR>&gt;<BR><BR>+------+ &nbsp; &nbsp;+------------+ 
    &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;+-------------+<BR>| 
    &nbsp;Bar |---o| &nbsp;Relation &nbsp;|o - - - - - - | &nbsp; &nbsp; Foo 
    &nbsp; &nbsp; |abstract<BR>+------+ &nbsp; &nbsp;+------------+ &nbsp; 
    &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;+-------------+class<BR>| &nbsp;id 
    &nbsp;| &nbsp; &nbsp;| &nbsp; attrs &nbsp; &nbsp;|o &nbsp; &nbsp; &nbsp; 
    &nbsp; &nbsp; &nbsp; | &nbsp; &nbsp; &nbsp;id &nbsp; &nbsp; |<BR>| name | 
    &nbsp; &nbsp;+------------+ \_________ &nbsp; | &nbsp; &nbsp; name &nbsp; 
    &nbsp;|<BR>+------+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
    &nbsp; &nbsp;\ &nbsp; &nbsp; &nbsp; &nbsp;\ &nbsp;+-------------+<BR>&nbsp; 
    &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
    &nbsp; &nbsp; \ &nbsp; &nbsp; &nbsp; &nbsp;\___^_____ &nbsp; 
    &nbsp;^<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
    &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\ &nbsp; &nbsp; &nbsp; &nbsp; 
    &nbsp; | &nbsp; &nbsp; \ &nbsp; |<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
    &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \ 
    +------------+ &nbsp;+-------------+<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
    &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
    &nbsp;\| &nbsp;NoisyFoo &nbsp;| &nbsp;| ColouredFoo |<BR>&nbsp; &nbsp; 
    &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
    &nbsp; &nbsp; &nbsp; +------------+ &nbsp;+-------------+<BR>&nbsp; &nbsp; 
    &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
    &nbsp; &nbsp; &nbsp; | &nbsp; &nbsp; id &nbsp; &nbsp; | &nbsp;| &nbsp; 
    &nbsp; id &nbsp; &nbsp; &nbsp;|<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
    &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | 
    &nbsp;decibels &nbsp;| &nbsp;| &nbsp; &nbsp;color &nbsp; &nbsp;|<BR>&nbsp; 
    &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
    &nbsp; &nbsp; &nbsp; &nbsp; +------------+ &nbsp;+-------------+<BR><BR>&gt; 
    +-------------+<BR>&gt;<BR>&gt; Bar has many Relations<BR>&gt; NoisyFoo has 
    many Relations<BR>&gt; ColouredFoo has many Relations<BR>&gt; Bar many-many 
    NoisyFoos<BR>&gt; Bar many-many ColouredFoos<BR>&gt;<BR>&gt; (Bar many-many 
    Foos?)<BR>&gt;<BR>&gt;<BR>&gt; NoisyFoo and ColouredFoo inherit from 
    Foo<BR>&gt;<BR>&gt; It actually gets more complicated than this 
    because<BR>&gt; - Bar and Foo both inherit from a base object.<BR>&gt; - All 
    objects have a unique id are connected via Relation objects<BR>&gt; - The 
    relation object also contains levels of inheritance<BR>&gt;<BR>&gt; I want 
    to be able to do queries like<BR>&gt;<BR>&gt; 1) Given a Bar, find all 
    related Foo objs<BR>&gt; 2) Given a NoisyFoo or Coloured Foo, find all 
    related Bars<BR>&gt; 3) For all bars with name matching "%str%" find all 
    NoisyFoos<BR>&gt; with decibels &gt; '100'<BR>&gt;<BR>&gt; Im not sure 
    whether it would be better to<BR>&gt; a) retain Foo, NoisyFoo and 
    ColouredFoo as a 3 separate tables,<BR>&gt; b) flatten to 2 tables, so 
    NoisyFoo and ColouredFoo get their<BR>&gt; own name column<BR>&gt; c) 
    flatten all Foos to 1 Foo table and create a Type column<BR>&gt; to 
    differentiate.<BR>&gt;<BR>&gt;<BR>&gt; Questions:<BR>&gt;<BR>&gt; &nbsp;Is 
    it possible to create Foo, NoisyFoo and ColouredFoo as<BR>&gt; separate 
    tables (a), then create corresponding DBIx proxy<BR>&gt; classes for them in 
    such a way that when I create a new<BR>&gt; NoisyFoo row, the 'name' value 
    is automatically entered into<BR>&gt; the Foo table? And when I retrieve the 
    row it is<BR>&gt; automatically read in from the Foo 
    table?<BR>&gt;<BR>&gt;<BR>&gt; If I were to flatten to 1 table per subclass 
    (b), how would I<BR>&gt; write a relationship that enabled me to perform 
    query (1)<BR>&gt; above; find all Foos for a given Bar.<BR>&gt; 
    --------------------------------------------------------<BR>&gt;<BR>&gt; 
    NOTICE: If received in error, please destroy and notify<BR>&gt; sender. 
    Sender does not intend to waive confidentiality or<BR>&gt; privilege. Use of 
    this email is prohibited when received in error.<BR>&gt;<BR>&gt; 
    _______________________________________________<BR>&gt; List: <A 
    href="http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class" 
    target=_blank>http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class</A><BR>&gt; 
    IRC: <A href="http://irc.perl.org#dbix-class" 
    target=_blank>irc.perl.org#dbix-class</A><BR>&gt; SVN: <A 
    href="http://dev.catalyst.perl.org/repos/bast/DBIx-Class/" 
    target=_blank>http://dev.catalyst.perl.org/repos/bast/DBIx-Class/</A><BR>&gt; 
    Searchable Archive:<BR>&gt; <A 
    href="http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk" 
    target=_blank>http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk</A><BR>&gt;<BR>--------------------------------------------------------<BR><BR>NOTICE: 
    If received in error, please destroy and notify sender. Sender does not 
    intend to waive confidentiality or privilege. Use of this email is 
    prohibited when received in 
    error.<BR><BR>_______________________________________________<BR>List: <A 
    href="http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class" 
    target=_blank>http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class</A><BR>IRC: 
    <A href="http://irc.perl.org#dbix-class" 
    target=_blank>irc.perl.org#dbix-class</A><BR>SVN: <A 
    href="http://dev.catalyst.perl.org/repos/bast/DBIx-Class/" 
    target=_blank>http://dev.catalyst.perl.org/repos/bast/DBIx-Class/</A><BR>Searchable 
    Archive: <A 
    href="http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk" 
    target=_blank>http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk</A><BR></DIV></DIV></BLOCKQUOTE></DIV><BR></BLOCKQUOTE></DIV>
<DIV>
<HR>
</DIV>
<P CLASS="BulletedList" STYLE="MARGIN: 0in 0in 0pt; TEXT-INDENT: 0in; mso-list: none; tab-stops: .5in"><SPAN STYLE="FONT-SIZE: 8pt; COLOR: gray; mso-bidi-font-family: Arial"><FONT FACE="Arial" COLOR="gray" SIZE="1">NOTICE: If received in error, please destroy and notify sender. Sender does not intend to waive confidentiality or privilege. Use of this email is prohibited when received in error.</FONT></SPAN></P>
<DIV>
</DIV></BODY></HTML>