Re: [RDBO] Advanced Joins -my last question of the week (i promise)

2006-07-29 Thread Jonathan
In essence, I agree with what you're saying... in my base class i have: relationships ( privacy_override__subordinates=> { class=> 'Overrides', key_columns=> { id=> 'id__viewed_by' }, type=> 'one to one', }, privacy_override_

Re: [RDBO] DELETE before INSERT during save()

2006-07-29 Thread John Siracusa
On 7/29/06 7:17 PM, Kurt Hansen wrote: > $b1 = Basket->new(...); > $p1 = Person->new(...); > $b1->persons($p1); > $b1->save(); # "I'd enter one entry" > > $b2 = Basket->new(...); > $p2 = Person->new(...); > $b2->persons($p2); > $b2->save(); # "I entered another entry" > >

Re: [RDBO] DELETE before INSERT during save()

2006-07-29 Thread Kurt Hansen
John Siracusa wrote: > >On 7/29/06 3:53 PM, Kurt Hansen wrote: > > >>package Basket; >>[...] >>relationships => [ >> persons => { >> type => 'one to many', >> class => 'Person', >> column_map => { Item => 'Item' }, >>}, >>[...] >>I'd ent

Re: [RDBO] Bug in save() where only field is primary key

2006-07-29 Thread Danial Pearce
>> I found a bug a couple weeks back where I had a DB structure that had >> this odd table hanging around where the only field was the primary >> key, which was also a foreign key. I found at the time that you could >> create a new() on that object, which would save() fine. But if you >> ever wante

Re: [RDBO] Advanced Joins -my last question of the week (i promise)

2006-07-29 Thread John Siracusa
On 7/29/06 4:21 PM, Jonathan Vanasco wrote: > what we should have asked is for the planner to conditionally join > the table -- so we get the null values if the condition isn't met Ah, gotcha. >> If a were to add the ability to augment the join conditions in a Manager >> query, what would the sy

Re: [RDBO] Advanced Joins -my last question of the week (i promise)

2006-07-29 Thread Jonathan Vanasco
On Jul 29, 2006, at 10:05 AM, John Siracusa wrote: > Join conditions are determined by the relationship or fk metadata, > and they > do not currently support nested boolean logic. But it shouldn't > matter > whether those conditions are in the ON (...) clause or in the WHERE > clause, > sho

Re: [RDBO] DELETE before INSERT during save()

2006-07-29 Thread John Siracusa
On 7/29/06 4:19 PM, John Siracusa wrote: > For more information on the methods created for each relationship, look at the > "method map" section of the relationship docs and follow the links to the > descriptions of the actual methods: Oops, hit send by accident. Here's the link: http://search.c

Re: [RDBO] DELETE before INSERT during save()

2006-07-29 Thread John Siracusa
On 7/29/06 3:53 PM, Kurt Hansen wrote: > package Basket; > [...] > relationships => [ >persons => { > type => 'one to many', > class => 'Person', > column_map => { Item => 'Item' }, > }, > [...] > I'd enter one entry with a transactio

[RDBO] DELETE before INSERT during save()

2006-07-29 Thread Kurt Hansen
Hello, I just solved a problem that was most likely due to my lack of understanding of RDBO. I just wanted to pass it along in case other newbies run into the same issue. Breaking the problem down to its simplest form, I have two tables in a one-to many relationship. The problem was that subse

Re: [RDBO] wishlist, maybe?

2006-07-29 Thread Jonathan Vanasco
On Jul 29, 2006, at 9:44 AM, John Siracusa wrote: > A what now? Data structure? These are objects! No poking around > as if > they were mere hashes! :) Methods are the approved way to modify > the tree > of objects. Fiddling around with the undocumented internals will > only lead > to

Re: [RDBO] Auto init and foreign keys

2006-07-29 Thread John Siracusa
On 7/28/06 9:02 AM, Ritesh Errno wrote: > I am following the canoical method of auto init like this - > > __PACKAGE__->meta->table("footable"); > __PACKAGE__->meta->auto_initialize; > > But it does not pick up the foreign keys, since the table -> class mapping > does not follow the convention. >

Re: [RDBO] Advanced Joins -my last question of the week (i promise)

2006-07-29 Thread John Siracusa
On 7/28/06 8:43 PM, Jonathan Vanasco wrote: > My code below creates SQL that is essentially: > SELECT t1.* , t2.* FROM useraccount_link t1 LEFT OUTER JOIN > useraccount_link_privacysetting_override t2 ON(t1.id = > t2.useraccount_link_id) > WHERE > t1.is_deleted = false AND > t1.useraccount_id = 12

[RDBO] Auto init and foreign keys

2006-07-29 Thread Ritesh Errno
First Rose DB rocks! I am following the canoical method of auto init like this - __PACKAGE__->meta->table("footable"); __PACKAGE__->meta->auto_initialize; But it does not pick up the foreign keys, since the table -> class mapping does not follow the convention. I tried adding: __PACKAGE__

Re: [RDBO] can't figure out a query

2006-07-29 Thread John Siracusa
On 7/28/06 5:36 PM, Jonathan Vanasco wrote: > the issue is because: > > privacy_override__subordinates == the object name, on the table > user_link_privacy_override > > with_objects takes the arguments of the relationship object > query builders take the arguments of the table name The query bui

Re: [RDBO] Pg inherited tables

2006-07-29 Thread John Siracusa
On 7/28/06 2:29 PM, Randal L. Schwartz wrote: > So I have $client who has abstract table B which is implemented as B1, B2, B3, > and B4, all inheriting B. There are no B rows. However, there's table A > which asks for a "B" as a foreign key reference. If there are no B rows, how does that work i

Re: [RDBO] wishlist, maybe?

2006-07-29 Thread John Siracusa
On 7/28/06 1:55 PM, Jonathan Vanasco wrote: > if i load something with a with_objects, and get a structure like this: A what now? Data structure? These are objects! No poking around as if they were mere hashes! :) Methods are the approved way to modify the tree of objects. Fiddling around wit

Re: [RDBO] Bug in save() where only field is primary key

2006-07-29 Thread John Siracusa
On 7/28/06 9:59 AM, Danial Pearce wrote: > I found a bug a couple weeks back where I had a DB structure that had > this odd table hanging around where the only field was the primary > key, which was also a foreign key. I found at the time that you could > create a new() on that object, which would

Re: [RDBO] Debug and load(with => ...)

2006-07-29 Thread John Siracusa
On 7/28/06 5:34 AM, Danial Pearce wrote: > If you use the "with" support in the load() method, you get no SQL > when you turn $Rose::DB::Object::Debug to 1. I tried to write a patch > for you, but i got lost :-) That's because it's really the Manager doing the loading for you in that case. Try tu

Re: [RDBO] Common Manager method names

2006-07-29 Thread John Siracusa
On 7/26/06 2:16 PM, Wiggins d'Anconia wrote: > And I can call the get_objects* methods directly but was wondering why > the 'object_class' argument must be passed each time, if I have already > set a 'sub object_class' with that data in the Manager class that I am > using. Yeah, that sounds reason

[RDBO] Advanced Joins -my last question of the week (i promise)

2006-07-29 Thread Jonathan Vanasco
This is killing me.. My code below creates SQL that is essentially: SELECT t1.* , t2.* FROM useraccount_link t1 LEFT OUTER JOIN useraccount_link_privacysetting_override t2 ON(t1.id = t2.useraccount_link_id) WHERE t1.is_deleted = false AND t1.use

[RDBO] Debug and load(with => ...)

2006-07-29 Thread Danial Pearce
If you use the "with" support in the load() method, you get no SQL when you turn $Rose::DB::Object::Debug to 1. I tried to write a patch for you, but i got lost :-) Also, is there any sort of "cascade" support for save()? I notice there is support in delete(). If there isn't, would the best

Re: [RDBO] can't figure out a query

2006-07-29 Thread Jonathan Vanasco
replying to myself: the issue is because: privacy_override__subordinates == the object name, on the table user_link_privacy_override with_objects takes the arguments of the relationship object query builders take the arguments of the table name or=> [

[RDBO] Common Manager method names

2006-07-29 Thread Wiggins d'Anconia
New to Rose:: so please be gentle. I have run into the same problem with needing to be able to call the manager methods without knowing their names ahead of time. See recent post here: http://sourceforge.net/mailarchive/forum.php?thread_id=11198586&forum_id=46239 And I can call the get_objects*

[RDBO] Bug in save() where only field is primary key

2006-07-29 Thread Danial Pearce
I found a bug a couple weeks back where I had a DB structure that had this odd table hanging around where the only field was the primary key, which was also a foreign key. I found at the time that you could create a new() on that object, which would save() fine. But if you ever wanted to ca