In my DB I have two "business" objects:
- City (id: int, name: varchar)
- Connection (id: int, other fields that are not needed here) - It describes the list of Cities that is on path (i.e. for bus that are going from city to city)
To join this tables I have one more table connection_city:
- city_id - id of city
- connection_id - id of connection
- number - the number in connection path
The problem for my is how to get all connections with path from DB in the fastest way.
Now I'm quering for all connection_city that have
cc_id = from_id OR cc_id = to_id and then I'm parsing it in my Java (Android) code.