-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: ORM.
PostPosted: Wed Oct 19, 2005 8:30 am 
Newbie

Joined: Wed Oct 19, 2005 8:04 am
Posts: 19
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.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 19, 2005 8:54 am 
Senior
Senior

Joined: Thu Aug 04, 2005 4:54 am
Posts: 153
Location: Birmingham, UK
You'd probably be better off just having city as a class. Then creating an adjacancy matrix from all cities to calculate shortest paths. This is more efficient than creating a class for every city - city distance relationship.

Get a good textbook on Geographical Infomation Systems and research adjacancy matrices to get a better grip on the problem domain.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 19, 2005 9:25 am 
Newbie

Joined: Wed Oct 19, 2005 8:04 am
Posts: 19
Well using Hibernate is a must.
For implementing busyness logic i will use Dijkstra algorythm, it is not that difficult to count shortest way.
But i don't know what OR maping to use.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.