Only lookup id in join if no connection exists
Only lookup id in join if no connection exists

This makes it possible to use join tables that lack primary id

Example:

Table: test1(id, data)
Table: test2(id, data)
Table: test1_test2_join(test1_id, test2_id) (both foreign keys)

Then run
Test1::count(array("test1_test2_join.test2.data"=>'foo'))
Before this fix that would give the error "no primary key in
test1_test2_join, but this commit fixes that.

edruid/BasicObject,NitroXy/BasicObject,NitroXy/BasicObject