Ticket #321 (closed defect: fixed)
Support aliases with QQ
| Reported by: | VexedPanda | Owned by: | somebody |
|---|---|---|---|
| Priority: | important | Milestone: | 1.1.2 |
| Component: | QQuery | Version: | 1.0.0 Stable |
| Keywords: | Cc: |
Description
Right now, there's no way in QQ to accomplish the following query without using SubSQL:
select u.* from users as u left join project_user_assn as pu1 on pu1.user_id = u.id left join project_user_assn as pu2 on pu2.user_id = u.id where pu1.project_id = 1 and pu2.project_id = 2
Perhaps syntax like this?
QQ::AndCondition( QQ::Equal(QQ::Alias(QQN::User(), Projects, 'pu1')->ProjectId, 1), QQ::Equal(QQ::Alias(QQN::User(), Projects, 'pu2')->ProjectId, 2) )
QQ::Alias would simply return a QQNode, so the rest of the code would be unchanged, it would just be smart enough to realize that the pu1 alias and the pu2 alias should result in different aliases for the join (QQN::User() to QQN::User()->Projects) passed in.
Attachments
Change History
Note: See
TracTickets for help on using
tickets.

