Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Hibernate

 
Ranch Hand
Posts: 49
Hibernate Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

If the database has 100 tables
we have to create 100 hibernate mapping files and 100 pojo files
is it worthy one for creating a web appilication
kindly suggest the comments

 
clojure forum advocate
Posts: 3479
Mac Objective C Clojure
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry Mariya but I'm not following you, what do you mean by:

is it worthy one for creating a web appilication

 
Mariya Antony christopher
Ranch Hand
Posts: 49
Hibernate Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Hussein Baghdadi wrote:Sorry Mariya but I'm not following you, what do you mean by:

is it worthy one for creating a web appilication


if the database has 100 tables
is it comfortable for writing CRUD operation code using hibernate
 
Bartender
Posts: 4109
72
Hibernate Fedora Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Mariya Antony christopher wrote:...is it comfortable for writing CRUD operation code using hibernate


What kind of comfortability you are looking at here...? Are you comparing any other ORM framework or with plain JDBC programming?
 
Mariya Antony christopher
Ranch Hand
Posts: 49
Hibernate Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
comparing jdbc database coding with hibernate for 100 tables in a database

 
Vijitha Kumara
Bartender
Posts: 4109
72
Hibernate Fedora Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes in that case you need to create the mapping files in Hibernate but it might give you a lot less maintenance work and also avoid boilerplate JDBC code.
 
Mariya Antony christopher
Ranch Hand
Posts: 49
Hibernate Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Vijitha Kumara wrote:Yes in that case you need to create the mapping files in Hibernate but it might give you a lot less maintenance work and also avoid boilerplate JDBC code.


what do you meant by boilerplate JDBC code?how the problem occurs?
kindly suggest!
 
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If creating the 100 class models are too much, create only those who you'll use on that webservice. But remember that when you create one, you can use it on every application you develop.
 
Vijitha Kumara
Bartender
Posts: 4109
72
Hibernate Fedora Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Mariya Antony christopher wrote:

Vijitha Kumara wrote:Yes in that case you need to create the mapping files in Hibernate but it might give you a lot less maintenance work and also avoid boilerplate JDBC code.


what do you meant by boilerplate JDBC code?how the problem occurs?...


It's that your are given the opportunity to configure most of them from xml and avoid many other tasks such as creating entities from retrieved rows etc...
 
Ranch Hand
Posts: 2187
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If an application needs 100 different types of data object, then it needs 100 different types of data object. If you decide to write hand-written JDBC code or use a Hibernate implementation, the application still needs 100 different types of data objects. You cannot effectively use the total number of data objects as a realistic metric to determine whether to use an ORM framework or write the data access code from scratch.

The key here is to clearly identify what the requirements of the application are. Speculating or guessing that you will need to actually create 100 tables and also need 100 different types of data object is not productive analysis. The idea that you would need a Java class for every data table in a database is a bit fuzzy and misleading. Aside, Hiberate mappings can be designed to extract from many tables in order to create a single persistent object.

Data requirements should be based on clearly written application requirements and design. If you are attempting to build an application and are starting to design a relational database first, you most likely will end up with a weak application design.

Keep in mind that Hibernate is a powerful, ultra-high performance framework. It is highly unlikely that you can write more efficient code than the Hibernate programmers. This is one of the primary reasons why using Hibernate is a best practice.
 
WHAT is your favorite color? Blue, no yellow, ahhhhhhh! Tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic