Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

I have a hibernate question

 
Swaroop Kunduru
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have an application with Customer, Order, Product, Parts. Out of this Parts should be selected from the table. How can I develop the application using Hibernate to include the code to create table structure with this scenario,

Thanks in Advance.

Swaroop Kunduru.
 
William P O'Sullivan
Ranch Hand
Posts: 859
Chrome IBM DB2 Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So you want to use ORM? (Object to Relational Mapping)?

Define your classes.

Use the proper Hiberate annotations (table, ometomany etc..)

Tell your application to use Hibernate and tell Hibernate to create or update the tables upon startup.

If you want to see the DDL created, turn hibernate logging on and prepare to be amazed ...

WP
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!