Re: [CDBI] Two has_a Relationships to the Same Table?

"Mertel, Mark" <[email protected]> Wed, 23 Apr 2008 06:13:14 -0700
Newsgroups gmane.comp.lang.perl.modules.class-dbi
Message-ID <5A47E93D8A435A46ACB00B87A3A723BE12FC196E@BD01MSXMB014.US.Cingular.Net>
This is a multi-part message in MIME format.

--===============1837526731==
Content-class: urn:content-classes:message
Content-Type: multipart/alternative;
	boundary="----_=_NextPart_001_01C8A543.C9D4557D"

This is a multi-part message in MIME format.

------_=_NextPart_001_01C8A543.C9D4557D
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: quoted-printable

Did you use the mappings method? How about including your code snippet.

=20

---

Mark Mertel

TEK systems

Desk: 425.288.7214

Mobile: 206.353.2663

=20

________________________________

From: classdbi-bounces-uVLvtXkw1RPgjt3iqB9Uk5F3r5kRpbQ7rE5yTffgRl4@public.gmane.org
[mailto:classdbi-bounces-uVLvtXkw1RPgjt3iqB9Uk5F3r5kRpbQ7rE5yTffgRl4@public.gmane.org] On Behalf Of Dave
Mabe
Sent: Wednesday, April 23, 2008 6:06 AM
To: ClassDBI-uVLvtXkw1RPgjt3iqB9Uk5F3r5kRpbQ7rE5yTffgRl4@public.gmane.org
Subject: [CDBI] Two has_a Relationships to the Same Table?

=20

I've got one table (A) with a has_a relationship to another table (B).
I'd like to add another column to table A that is the foreign key for a
record in table B.

I tried to simply add the column and then put another has_a relationship
in the class for table A, but I get "Column does not exist" errors.  I
tried adding the new column name as a TEMP column in the class for table
B and also adding it as a table_alias for table B both of which give the
same error.

Any idea how to do this?  Is it possible to set up another class for
table B for the second relationship (still pointing to the data in the
same table)?

TIA

--=20
Dave Mabe
StockTickr - Trader Performance Analysis
We Make Traders More Profitable
http://www.stocktickr.com/

Every trade I make is blogged:
http://blog.stocktickr.com/=20


------_=_NextPart_001_01C8A543.C9D4557D
Content-Type: text/html;
	charset="US-ASCII"
Content-Transfer-Encoding: quoted-printable

<html xmlns:v=3D"urn:schemas-microsoft-com:vml" =
xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:st1=3D"urn:schemas-microsoft-com:office:smarttags" =
xmlns=3D"http://www.w3.org/TR/REC-html40">

<head>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dus-ascii">
<meta name=3DGenerator content=3D"Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]--><o:SmartTagType
 namespaceuri=3D"urn:schemas-microsoft-com:office:smarttags" =
name=3D"City"/>
<o:SmartTagType =
namespaceuri=3D"urn:schemas-microsoft-com:office:smarttags"
 name=3D"place"/>
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
 /* Font Definitions */
 @font-face
	{font-family:Tahoma;
	panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0in;
	margin-bottom:.0001pt;
	font-size:12.0pt;
	font-family:"Times New Roman";}
a:link, span.MsoHyperlink
	{color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{color:blue;
	text-decoration:underline;}
p.MsoAutoSig, li.MsoAutoSig, div.MsoAutoSig
	{margin:0in;
	margin-bottom:.0001pt;
	font-size:12.0pt;
	font-family:"Times New Roman";}
span.EmailStyle17
	{mso-style-type:personal-reply;
	font-family:Arial;
	color:navy;}
@page Section1
	{size:8.5in 11.0in;
	margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
	{page:Section1;}
-->
</style>

</head>

<body lang=3DEN-US link=3Dblue vlink=3Dblue>

<div class=3DSection1>

<p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span =
style=3D'font-size:
10.0pt;font-family:Arial;color:navy'>Did you use the mappings method? =
How about
including your code snippet.<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span =
style=3D'font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<div>

<p class=3DMsoAutoSig><font size=3D3 color=3Dnavy face=3D"Times New =
Roman"><span
style=3D'font-size:12.0pt;color:navy'>---<o:p></o:p></span></font></p>

<p class=3DMsoAutoSig><font size=3D3 color=3Dnavy face=3D"Times New =
Roman"><span
style=3D'font-size:12.0pt;color:navy'>Mark =
Mertel<o:p></o:p></span></font></p>

<p class=3DMsoAutoSig><font size=3D3 color=3Dnavy face=3D"Times New =
Roman"><span
style=3D'font-size:12.0pt;color:navy'>TEK =
systems<o:p></o:p></span></font></p>

<p class=3DMsoAutoSig><font size=3D3 color=3Dnavy face=3D"Times New =
Roman"><span
style=3D'font-size:12.0pt;color:navy'>Desk: =
425.288.7214<o:p></o:p></span></font></p>

<p class=3DMsoAutoSig><st1:City w:st=3D"on"><st1:place w:st=3D"on"><font =
size=3D3
  color=3Dnavy face=3D"Times New Roman"><span =
style=3D'font-size:12.0pt;color:navy'>Mobile</span></font></st1:place></s=
t1:City><font
color=3Dnavy><span style=3D'color:navy'>: =
206.353.2663<o:p></o:p></span></font></p>

</div>

<p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span =
style=3D'font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<div>

<div class=3DMsoNormal align=3Dcenter style=3D'text-align:center'><font =
size=3D3
face=3D"Times New Roman"><span style=3D'font-size:12.0pt'>

<hr size=3D2 width=3D"100%" align=3Dcenter tabindex=3D-1>

</span></font></div>

<p class=3DMsoNormal><b><font size=3D2 face=3DTahoma><span =
style=3D'font-size:10.0pt;
font-family:Tahoma;font-weight:bold'>From:</span></font></b><font =
size=3D2
face=3DTahoma><span style=3D'font-size:10.0pt;font-family:Tahoma'>
classdbi-bounces-uVLvtXkw1RPgjt3iqB9Uk5F3r5kRpbQ7rE5yTffgRl4@public.gmane.org
[mailto:classdbi-bounces-uVLvtXkw1RPgjt3iqB9Uk5F3r5kRpbQ7rE5yTffgRl4@public.gmane.org] <b><span =
style=3D'font-weight:
bold'>On Behalf Of </span></b>Dave Mabe<br>
<b><span style=3D'font-weight:bold'>Sent:</span></b> Wednesday, April =
23, 2008
6:06 AM<br>
<b><span style=3D'font-weight:bold'>To:</span></b>
ClassDBI-uVLvtXkw1RPgjt3iqB9Uk5F3r5kRpbQ7rE5yTffgRl4@public.gmane.org<br>
<b><span style=3D'font-weight:bold'>Subject:</span></b> [CDBI] Two has_a
Relationships to the Same Table?</span></font><o:p></o:p></p>

</div>

<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:
12.0pt'>I've got one table (A) with a has_a relationship to another =
table
(B).&nbsp; I'd like to add another column to table A that is the foreign =
key
for a record in table B.<br>
<br>
I tried to simply add the column and then put another has_a relationship =
in the
class for table A, but I get &quot;Column does not exist&quot; =
errors.&nbsp; I
tried adding the new column name as a TEMP column in the class for table =
B and
also adding it as a table_alias for table B both of which give the same =
error.<br>
<br>
Any idea how to do this?&nbsp; Is it possible to set up another class =
for table
B for the second relationship (still pointing to the data in the same =
table)?<br>
<br>
TIA<br clear=3Dall>
<br>
-- <br>
Dave Mabe<br>
StockTickr - Trader Performance Analysis<br>
We Make Traders More Profitable<br>
<a =
href=3D"http://www.stocktickr.com/">http://www.stocktickr.com/</a><br>
<br>
Every trade I make is blogged:<br>
<a href=3D"http://blog.stocktickr.com/">http://blog.stocktickr.com/</a> =
<o:p></o:p></span></font></p>

</div>

</body>

</html>

------_=_NextPart_001_01C8A543.C9D4557D--


--===============1837526731==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
ClassDBI mailing list
ClassDBI-Ra3b/[email protected]
http://lists.digitalcraftsmen.net/mailman/listinfo/classdbi

--===============1837526731==--