Hi, I tried to translate this piece of code:
https://gist.github.com/2788715 using ScalaQuery. The result is here:
https://gist.github.com/c1d6f4faf7f06e04e4d3I’d like to know if I’m using ScalaQuery in the right way or if I did some mistakes, if it’s possible to make the code more elegant, etc.
Was there a better way to handle multiple left joins?
The generated code is the following:
SELECT "t1"."ID","t1"."TITLE","t1"."SUMMARY","t1"."START","t1"."END","t1"."PLACE","t1"."IMAGEURL","t1"."AUTHOR","t2"."EMAIL","t2"."NAME","t4"."ID","t4"."TITLE","t4"."SUMMARY","t4"."IMAGEURL","t4"."AUTHOR"
FROM "EVENTS" "t5","EVENTS_SUBJECTS" "t6" inner join "SUBJECTS" "t4"
on ("t6"."SUBJECT_ID"="t4"."ID"),"EVENTS" "t1","USERS" "t2"
WHERE ("t1"."ID"=42) AND ("t2"."EMAIL"="t5"."AUTHOR") AND
("t6"."EVENT_ID"="t5"."ID")
What’s weird to me is that the EVENTS table is used two times (it’s aliased in t1 and t5). Will the result be correct?
Regards,
Julien