With RDBO 0.760 I have a class setup like the following,

__PACKAGE__->meta->setup(
   table   => 'users',

   columns => [
     id             => { type => 'integer', not_null => 1 },
     email          => { type => 'varchar', default => '', length =>  
255, not_null => 1 },
     name           => { type => 'varchar', length => 255 },
     pass           => { type => 'varchar', length => 255 },
     nomail         => { type => 'enum', default => '0', not_null =>  
1, values => [ '0', 1 ] },
     bitcard_id     => { type => 'character', length => 40 },
     username       => { type => 'varchar', length => 40 },
     public_profile => { type => 'integer', default => '0', not_null  
=> 1 },
   ],

   primary_key_columns => [ 'id' ],

   unique_keys => [
     [ 'email' ],
     [ 'username' ],
   ],

...
);

When I run Foo::Model::User::Manager->new(username => 'ask')->load 
(speculative => 1)

the generated SQL is

SELECT bitcard_id, email, id, name, nomail, pass, public_profile,  
username FROM users WHERE email = ? - bind params:

(notice how it's using the wrong query and that the parameter isn't  
used).

If I reverse the order in the unique_keys array it works for the  
username, but not for the email column.

I'd add a test to the test suite, but I'm having trouble figuring out  
where to put it.  :-)


  - ask

-- 
http://develooper.com/ - http://askask.com/



-------------------------------------------------------------------------
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
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object

Reply via email to