On Mon, February 12, 2007 5:56 pm, Jonathan Vanasco wrote:
>
> On Feb 12, 2007, at 3:31 PM, Ask Bjørn Hansen wrote:
>
>> This will solve the problem for me, but it really doesn't seem quite
>> right.  Having to do ->new->load is already odd too.
>>
>> I guess what I really want is to be able to do
>>
>>     $object_class->load(key1 => $value, key2 => $value2)
>>
>> and have it work like load(speculative => 1)
>
> no, it works as one would expect.  the problem is that you specified
> the string '' as a default value ( or mysql did ).    rose is
> treating the query exactly as it should by design.
>
> loading based only on what is passed in the argument -- and ignoring
> anything else in the object -- is a good idea though.  +1 for that.
> maybe a special flag would need to be in the load though , to make
> sure there isn't a compatibility issue.

Yes. I would suggest a flag like that to load would be better than having
to specify the key. If the call to ->new->load is down inside some library
the code calling load may not know the key name.

This could be done by adding a column_exists method to RDBO which would
only return true if the named column had been loaded from the DB or set
by calling the accessor method. And have ->load use column_exists instead
of defined when passed a flag,for example ->load(explicit =>1) (or some
better name)

> and i don't like the 'key' parameter.   its a semantic thing.
> 'using_key' or 'on_key' would be much better for me personally.  key
> seems too generic -- even in context.

+1

Graham


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Rose-db-object mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rose-db-object

Reply via email to