Hi,

I have a table with a single column primary key. However, in certain
situations, I would like to access a row by matching both the primary
key and another column on that table. The two form a unique key.

I am wondering whether I can use the new() method to do both

My::Table->new(pk => 1) AND
My::Table->new(pk => 1, col2 => 2)

or whether I would have to use the Manager method get_ for the second case

my $files = My::Table::Manager->get_ (query => [ pk => 1,

 col2 => 2 ]);
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?

Thanks for any comments/suggestions.

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