Hi. I am tottaly new to Hibernate.
I need help with creating ORM.
I have red lots of documentations, still doubt i have right model.
I have 2 tables:
Class City
1) Table Cities:
CityID<------------one2many---------CityIDa/CityIDa
CityName
CityPolulation
DateAdded
Class Distance
2)Table Distances(between 2 cities)
DistanceID
CityIDa>--------------------many2one--------City.CityID
CityIDb>--------------------many2one--------City.CityID
DistanceKm
Idea was that there are table cities where we store information about cities and table distances where we will store distance in kilometers between cities.
This way i have a graph of cities, and i need to find shortest path from one city to another when user requests.
Anybody could help me with solving my noob problem?
Thnx a lot.
|