Hello-

I'm still working with many to many relationships via a 3 column mapping 
table. However, in this case, the third column in the mapping table 
joining users and projects is a description of the relationship, the 
"role" of the project contact.

my tables are: Project, User, ProjectUserMap

the ProjectUserMap has:
        project_id      NOT NULL REFERENCES project (id),
        user_id         NOT NULL REFERENCES user (id),
        role            VARCHAR(255)

So I'd like to do something like:

my $project = Project->new( id => 1)->load;
for my $contact ( $project->users( with_map_records => 1 ) ) {
        print $contact->map_record->role, ":" , $contact->name, "\n";
}

I know that I can retrieve map record when using the Manager class, but 
because I have a number of many to many relationships in the Project 
class, I don't want to have retrieve all of them with the Project 
object's manager class.

As you suggested with my previous 3-way join problem, I could add 
another one-to-many field called contact_maps from Project -> 
ProjectUserMap, but that technique seems cumbersome and defeats the 
purpose of having a many-to-many join available.

Is there a way to do this now, and/or can I request this feature :)

Thanks,

- jud

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object

Reply via email to