wood burning stoves 2.0*
The moose likes Object Relational Mapping and the fly likes converting database tables into POJO Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "converting database tables into POJO" Watch "converting database tables into POJO" New topic
Author

converting database tables into POJO

Rauhl Roy
Ranch Hand

Joined: Aug 01, 2006
Posts: 401

may I know how to convert database into Hibernate POJO classes.

I want to know how to design/define 1...m , 1..1, m..m in POJOs of Hibernate.

many thanks in advance,
Rahul.
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Bit of a vague question this. Are you asking about auto generating java classes or how to define associations?


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

The Hibernate mappings are covered in the Hibernate documentation.
Rauhl Roy
Ranch Hand

Joined: Aug 01, 2006
Posts: 401

Paul Sturrock wrote:Bit of a vague question this. Are you asking about auto generating java classes or how to define associations?



i am new to both hibernate and designing software components.

i am using oracle there i see 3 tables like department/ emp and some other table. what if i want to create a web application where the end user can submit the information abuot the employee to the database.

in otherwords, my web application uses hibernate as a middleware for curd operations. may i know how to design that.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Have you looked at the documentation? This is covered.
David Kilcy
Greenhorn

Joined: Aug 25, 2009
Posts: 20
Rauhl Roy wrote:
in otherwords, my web application uses hibernate as a middleware for curd operations. may i know how to design that.


You want to look at the MVC design pattern.
Model is your hibernate relational mapping
View is the web page for display
Controller is the code to interact with your model and view.

Let us know how you make out.
Rauhl Roy
Ranch Hand

Joined: Aug 01, 2006
Posts: 401

David Kilcy wrote:
Rauhl Roy wrote:
in otherwords, my web application uses hibernate as a middleware for curd operations. may i know how to design that.


You want to look at the MVC design pattern.
Model is your hibernate relational mapping
View is the web page for display
Controller is the code to interact with your model and view.

Let us know how you make out.


does it mean hibernate is used as a middle layer between database and controller?
David Kilcy
Greenhorn

Joined: Aug 25, 2009
Posts: 20
Rauhl Roy wrote:
David Kilcy wrote:
Rauhl Roy wrote:
in otherwords, my web application uses hibernate as a middleware for curd operations. may i know how to design that.


You want to look at the MVC design pattern.
Model is your hibernate relational mapping
View is the web page for display
Controller is the code to interact with your model and view.

Let us know how you make out.


does it mean hibernate is used as a middle layer between database and controller?


Yes
 
GeeCON Prague 2014
 
subject: converting database tables into POJO