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.

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.

what about also having rose validate the setup of the  schema?

the issue seems to stem from someone (or some db) saying: "hey, this  
is a unique field, and the  default value is ___".   but unique  
fields never really have scalar default values.  they have not null  
or null  constraints, and  maybe a  function as a default, but never  
a variable.

unless someone can educate me on a situation where this could  
possibly be wanted -- i sure as hell can't imagine it -- rose should  
die or warn on a setup with a '' default on a unique key.  if i used  
mysql myself, i'd make a hack for correcting the info from the db --  
but thankfully i use postgres and it works right :)

// Jonathan Vanasco

| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
- - - - - - - - - - - - - - - - - - -
| SyndiClick.com
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
- - - - - - - - - - - - - - - - - - -
|      FindMeOn.com - The cure for Multiple Web Personality Disorder
|      Web Identity Management and 3D Social Networking
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
- - - - - - - - - - - - - - - - - - -
|      RoadSound.com - Tools For Bands, Stuff For Fans
|      Collaborative Online Management And Syndication Tools
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
- - - - - - - - - - - - - - - - - - -



-------------------------------------------------------------------------
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