aspose file tools*
The moose likes Object Relational Mapping and the fly likes generating a data model Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "generating a data model" Watch "generating a data model" New topic
Author

generating a data model

nelson christos
Ranch Hand

Joined: Aug 08, 2006
Posts: 57
I need to create a table for the data being captured. The data is captured in the following format.

This data is for each vessel

SrNo LoadingPosition Hatch1 Hatch2 Hatch3 Hatch4 Hatch5 Total
A PRE STOWAGE PLAN
B LAST 24 HRS
C PREVIOUS
D TOTAL
E BALANCE


These are the details i need to store for different hatches and the hatches
are dynamic depending on the vessel. I need a data model or some object model to represent this.

Thanks in advance


i think therefore i am
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

Which ORM tool are you using Toplink or Hibernate, or some other ORM tool?

Thanks

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
nelson christos
Ranch Hand

Joined: Aug 08, 2006
Posts: 57
we are using Hibernate and came up with a model like this.
Each Vessel
---- has a Set of Positions
----------Each Position has a Set of Hatches.

So three tables to represent this . This looks fine.
However the the data to be stored differs on cargo type.
If it is a bulk cargo we have hatches , for petrol we have no hatches.

VESSEL
|
|
CARGODETAIL
^ ^
| |
BULK TANKER
|
HATCH

bulk and tanker are two categories of info we need to store
Should we go for table per class hierarchy to store both BULK AND TANKER
using a discriminator or go for table per subclass.

Thanks
nelson christos
Ranch Hand

Joined: Aug 08, 2006
Posts: 57
In the previous post BULK and TANKER are 2 types of cargo and
HATCH is associated only to bulk

Thanks
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

Have you tried using Hibernate tools to auto generate you tables based on your mapping?

Mark
nelson christos
Ranch Hand

Joined: Aug 08, 2006
Posts: 57
this is our first project in hibernate, so we are not going fully on a top down approach. we are creating the objects in UML and then we will be trying to create the tables in dB and later auto generate the hbm from ddl

Thanks

Nelson
[ March 28, 2008: Message edited by: nelson christos ]
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

Originally posted by nelson christos:
this is our first project in hibernate, so we are not going fully on a top down approach. we are creating the objects in UML and then we will be trying to create the tables in dB and later auto generate the hbm from ddl

Thanks

Nelson

[ March 28, 2008: Message edited by: nelson christos ]


Ah, well there is this other tool, I have never used it myself. The tool is called Andromda, or something like that, that supposedly can take UML and make Java objects, then use the Hibernate tool to create the tables. You can just play with it to see what kind of tables to create.

With this being an ORM forum, we don't do data modeling in threads.

Mark
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: generating a data model
 
Similar Threads
web based chatting application
Easy one
Constant Instance Variables vs Inheritance
One to Many relationship not inserting to one table
WA #1.....word association