[CDBI] Re: Many-to-Many - why no CDBI::Relationship?

"Edward J. Sabol" <sabol-2oVx0MVsMgiP/[email protected]>
Newsgroups gmane.comp.lang.perl.modules.class-dbi
Message-ID <[email protected]>
> Are most people happy writing custom SQL as needed? Or constructing
> the appropriate search query in Class::DBI::Sweet? As far as I can
> tell, Sweet can get many-to-many related objects with one query, but
> you have to construct the correct ->search.

FWIW, I don't use custom SQL or use CDBI::Sweet for my many-to-many
relationships. I've always been happy enough with the standard method for
defining many-to-many relationships in Class::DBI, as documented in the pod at
http://search.cpan.org/~tmtm/Class-DBI/lib/Class/DBI.pm#MANY_TO_MANY_RELATIONSHIPS

Would a HasManyToMany Relationship subclass be useful? Sure.

Aaron Trevena created the HasManyOrdered Relationship which claims to support
many-to-many relationships. I've never used it though. You might want to look
into that.

Later,
Ed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.