On 10/25/07 12:45 AM, Arshavir Grigorian wrote:
> In my class definition, I have
> 
> primary_key_columns => [ 'pk' ],
> unique_key => [ 'pk', 'col2' ],
> 
> Since, I am accessing the data more often using the 2 column match,
> does it make sense to trick Rose into thinking that my primary key is
> really a compound key (pk, col2), then just use
> get_() method to get the row matching pk only?

You can force load() to use a specific key by passing the use_key parameter.

http://search.cpan.org/dist/Rose-DB-Object/lib/Rose/DB/Object.pm#use_key

That said, if you have the value of pk, why would you ever want to load
using the unique key?

-John



-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object

Reply via email to