Re: one to one revisited (has_own)

[prev] [thread] [next] [Date index for 2005/01/25]

From: Peter Speltz
Subject: Re: one to one revisited (has_own)
Date: 19:34 on 25 Jan 2005
Finally Looking at this.  For those who don't know cause my email was way too
long, here's a summary of funtionality we'd like in mighthave:

make might_have a 0orM:1 relationship with contraints. See below for use
example.
make a M:1 relationship,  "has_own" maybe, for when you don't what the "might"
in might_have.  

example:

Here are customer address table columns:  
Address->columns(All => qw/addr_id cstmr_id addr_type street city state zip/);

# Declarations
# billing address required

Customer->has_own(billing_address => "Address" => qw/street city state zip/,
                  constraint => {addr_type => 'billing'}); 

Customer->might_have(service_exists_at => "Address" => (), 
                  constraint => { addr_type => "service" });
Customer->might_have(shipping_address  => "Address" => (), 
                  constraint =>  {addr_type => 'shipping'});

# Much more precise than has_many(addresses => "Address"). 
# We've specified all the types of addresses a person can have and which one 
# is required and consequentially, the default for all the other ones.
# Above makes something kind of like a has_many hash


Ok,  It seems i was wrong about might_have being a 0 or M to 1. Its a 0or1 to
1. I haven't used it but this assertion comes from  the id of the "owner" is
expected to be the id of the might_have. And both are single primary key
tables.  Is this accurate anyone?

Should be simple change at any rate to make it a 0orM to 1 with contraints.

I also notice in docs, it mentions requesting changes to might have and maybe
these is the kind of changes its talking about.

I'll work on it more after lunch.



=====
pjs


		
__________________________________ 
Do you Yahoo!? 
Yahoo! Mail - 250MB free storage. Do more. Manage less. 
http://info.mail.yahoo.com/mail_250

(message missing)

one to one relationship revisited (has_own)
Peter Speltz 22:26 on 20 Jan 2005

Re: one to one relationship revisited (has_own)
Perrin Harkins 21:59 on 21 Jan 2005

Re: one to one relationship revisited (has_own)
Peter Speltz 05:11 on 22 Jan 2005

Re: one to one revisited (has_own)
Peter Speltz 18:16 on 22 Jan 2005

Re: one to one revisited (has_own)
William McKee 15:39 on 24 Jan 2005

Re: one to one revisited (has_own)
Peter Speltz 16:01 on 24 Jan 2005

Re: one to one revisited (has_own)
Andreas Fromm 08:19 on 25 Jan 2005

Re: one to one revisited (has_own)
Peter Speltz 19:34 on 25 Jan 2005

Selecting from a datetime field in MySQL
John Day 22:24 on 25 Jan 2005

Re: Selecting from a datetime field in MySQL
Perrin Harkins 22:29 on 25 Jan 2005

Re: one to one revisited (has_own)
Peter Speltz 23:24 on 26 Jan 2005

Re: one to one revisited (has_own)
Peter Speltz 17:40 on 01 Feb 2005

Re: one to one revisited (has_own)
Peter Speltz 08:23 on 25 Jan 2005

Generated at 12:39 on 05 Feb 2005 by mariachi v0.52