Fix for #43: Equality expression not reversible in OneToMany

7 views
Skip to first unread message

Marco Rico-Gomez

unread,
Jan 17, 2011, 6:12:50 PM1/17/11
to squeryl-co...@googlegroups.com
Hi Max,

I worked on issue 43: "Equality expression not reversible in OneToMany" https://github.com/max-l/Squeryl/issues#issue/43

The changes can be reviewed here:
https://github.com/mrico/Squeryl/compare/master...mr_issue_43

My solution is to move the private method _splitEquality from ManyToManyRelationImpl to QueryDsl, so it can be used by the class OneToManyRelationImpl as well.

To test it I added a new relation subjectToCoursesRightLeft to SchoolDbMutableRelations which is the same as subjectToCourses but with reversed arguments. What do you think?

Cheers!

Maxime Lévesque

unread,
Jan 17, 2011, 7:33:16 PM1/17/11
to squeryl-co...@googlegroups.com

It looks good, for the test case, I suggest you pick any of the existing oneToMany and swap the equality 'via'
this way there will be a test case that uses the reversed oneToMany.
If the ManyToMany uses the same _splitEquality, make sure you swap one of the equality in the test suite as well
to make sure both all combination get tested.


Thanks

Marco Rico-Gomez

unread,
Jan 21, 2011, 3:21:07 PM1/21/11
to squeryl-co...@googlegroups.com
Hi Max,

Fix has been pushed to master. Thanks for the fast review.

Reply all
Reply to author
Forward
0 new messages