DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Database design for hibernate

  1. #1
    Join Date
    Apr 2009

    Database design for hibernate

    I'm a hibernate beginner and I have a very small seam application i'm building. Obviously hibernate is to be used but i'm a little confused as to what the database design should be. The application is basic:
    1. Two types of materials exist, raw material and processed materials.
    2. A processed material is to be constructed from two or more raw materials.
    3. The price of the raw materials is to be entered by the user and saved in the database.

    The basic design I have been able to come up with is placed as an image here. The problem with the design is that there is no way that I can load the quantity of the material as well without creating a seperate class from the base raw material class. The quantity can vary from 1 to 100 so can't hardcode it either. Any ideas? suggestions?


  2. #2
    Join Date
    Apr 2007
    Sterling Heights, Michigan
    Welcome to DevX

    What is the issue with creating another class?

    What database are you going to be using?

    What have you decided on for a primary key?

  3. #3
    Join Date
    Mar 2004
    You can use raw sql to insert the values in the relevant DB table with prices.

    Still it is much better if you use another class as this way you will have the hibernate version control and you can freely use all the feature that hibernate provides for you.

    With Seam and JBoss you do not have to use Hibernate. They integrate it and they provide it for you as default in the same way as Oracle container provide toplink for you. So feel free to use whatever you like. I think that Hibernate is a great choice and you can benefit a lot.
    There is no fear in the true love!

Similar Threads

  1. Database not properly created
    By Arjuna in forum Database
    Replies: 2
    Last Post: 07-25-2007, 03:22 AM
  2. design database table for survey form
    By darkestsky in forum Database
    Replies: 1
    Last Post: 10-15-2005, 02:07 PM
  3. Database design for database enabled web site
    By Nick in forum VB Classic
    Replies: 1
    Last Post: 12-14-2000, 03:59 PM
  4. Database design question
    By Jacob Hatley in forum VB Classic
    Replies: 4
    Last Post: 07-12-2000, 08:06 PM
  5. Client/Server database design
    By Leedo Leedo in forum VB Classic
    Replies: 0
    Last Post: 03-20-2000, 12:49 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center