db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thoralf Rickert" <thoralf.rick...@cadooz.de>
Subject AW: AW: AW: foreign-key generation maps NumberKey to int, and code fails to compile
Date Tue, 14 Aug 2007 08:26:53 GMT
In BaseCcsCouponPeer should be a doSelectJoinCcsMember() method. The other way around is not
implemented. So you need to program it yourself, I think. The member doesn't know about the
coupons, so it isn't possible to build automatically a doSelectJoinCcsCoupons. Additionally
in MemberPeer you try to SELECT a member and add multiple coupons to it. This isn't easy with
a single SELECT. (because the member has multiple coupons and you'll get multiple rows for
one member).

You could make two selects. First get the CcsMember and then call CcsMember.getCoupons().
This method is implemented in BaseCcsMember.


> -----Urspr√ľngliche Nachricht-----
> Von: brycenesbitt [mailto:bryce1@obviously.com] 
> Gesendet: Dienstag, 14. August 2007 10:14
> An: torque-user@db.apache.org
> Betreff: Re: AW: AW: foreign-key generation maps NumberKey to 
> int, and code fails to compile
> 
> 
> 
> Each coupon is owned by one member.
> A member may have any number of coupons.
> SQL has no trouble setting up such a relationship without a 
> third table.  Do I need the third table to satisfy Torque?
> 
> 
> Thoralf Rickert wrote:
> > 
> > Ah, okay, a coupon has only one member. Is it possible to have a 
> > member that has multiple coupons? Or is it a 1:1 relation? 
> If so, you 
> > could make a circle reference from member to coupon. If it is 1:n 
> > relation (I think so), then you should add a third table 
> > COUPON_MEMBER_RELATION with member_id,coupon_id as foreign keys and 
> > unique(member_id,coupon_id) and maybe unique(coupon_id).
> > 
> > bye
> > Thoralf
> > 
> 
> -- 
> View this message in context: 
> http://www.nabble.com/foreign-key-generation-maps-NumberKey-to
-int%2C-and-code-fails-to-compile-tf4265600.html#a12140496
Sent from the Apache DB - Torque Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Mime
View raw message