2
類
我開始學習DBIx ::類和我在相關表中查找一個疑問:使用關係,DBIx搜索::
考慮下面的代碼:
my $books = $author->search_related('books', { name => 'Titanic' });
my $books = $author->books->search({name => 'Titanic'});
我想要的只是作者在$author
中搜索名爲「泰坦尼克號」的書籍。
這兩個搜索返回相同的結果集?
如果是,那麼最好的方法是什麼?爲什麼?
如果不是,有什麼區別?