This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes ORM Patterns/Data structure question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "ORM Patterns/Data structure question" Watch "ORM Patterns/Data structure question" New topic

ORM Patterns/Data structure question

Sharon whipple
Ranch Hand

Joined: Jul 31, 2003
Posts: 294
Hi all,
I hope this is the correct forum for such topic; I am looking for a correct data structure for this problem.
I have several types of objects of the same type plane, each plane has different lubrication due dates, some have 1 part to lubricate, some have 10 parts to lubricate

Type, lub dates:
  • Cessna # engine lub date # wheel lub date
  • Jet plane # engine lub date # wheel lub date # prop lub date
  • jumbo 747 # engine1 lub date # engine2 lub date # wheels lub date (total 15 columns)
  • Antonov (This one... ) #engine1 .. .engine n lub date# wheels lub date (total 20 columns)

  • As far as ORM I was thinking of a flat table with [plane type] column and all possible lub dates as columns
    My debate is the Java side – how to represent this using JPA/Hibernate objects
    Should I use hibernate inheritance? Drawback from in inheritance is the need to recompile the code for each new plane, and mass amount of java classes, another problem is the need to handle each class in the UI separately

    Please advice for better data structure for this problem
    Thank you

    Jan Cumps

    Joined: Dec 20, 2006
    Posts: 2491

    I moved your post to our Object Relational Mapping forum.

    OCUP UML fundamental and ITIL foundation
    youtube channel
    I agree. Here's the link:
    subject: ORM Patterns/Data structure question
    Similar Threads
    Duplicate results in Hibernate many to many mapping.
    Dilemma to sort out
    Making arraylist from resultset
    3 tables to one .. one is to many relationship question
    Need help with a query (HQL)