Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

generating a data model

 
nelson christos
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which ORM tool are you using Toplink or Hibernate, or some other ORM tool?

Thanks

Mark
 
nelson christos
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the previous post BULK and TANKER are 2 types of cargo and
HATCH is associated only to bulk

Thanks
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you tried using Hibernate tools to auto generate you tables based on your mapping?

Mark
 
nelson christos
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic