Home
Webmaster and SEO Forum Home
05/16/12 06:13
Webmaster and SEO RSS Feed

Object-Relational Mapping with Hibernate Core and Hibernate Annotations


All listings are the responsiblity of the posters; keep in mind, anyone can post anything!
, real estate: Singapore property search
us





Advertisement:
Free promotion



Recent Notes and Tags
Search Tags:

Webmaster and SEO

Object-Relational Mapping with Hibernate Core and Hibernate Annotations


PreviousContentsNext

Thank author of this post/comment

So you already have your database setup and you are about to create your Java classes that you shall use for your web application. You then realize that it's necessary for you to access your database at runtime using your application. What are you going to do? Clearly, you can't access the database directly from your Java code. You'll be needing a separate library that shall handle those queries.

 

At this point, the JDBC (short term for Java Database Connectivity) may be used. It was introduced during version 1.1 of the Java 2 Platform, Standard Edition. The JDBC classes are contained in the Java package java.sql.

But using the JDBC to make your queries is not enough. While you can directly access your database using this library, there's what we call the object-relational impedance mismatch, wherein there are inconsistencies in the data because of the different handling mechanisms of Java and your RDBMS. For example, whitespaces are read by your Java code, while it is a terminating symbol for most RDBMS.

It is for this reason that we have object-relational mapping libraries such as Hibernate. Instead of directly handling persistence-related accesses directly, Hibernate provides high-level mechanisms that mask the mapping happening beneath.

Hibernate Core uses XML files to determine the mappings that it will have to do, while Hibernate Annotations uses Java annotations to do a similar move. I actually prefer the latter for easier readability, as your annotations are already included together with your bean classes. In order to use Hibernate Annotations, however, you have to use the Java Persistence API, which provides annotation definitions for Hibernate.

Right now, I'm still trying to understand more about Hibernate Annotations, especially when it comes to bidirectional relationship mapping between different entities. I've encountered a lot of errors out of the way but, fortunately, I was already able to generate my first database schema using Hibernate Annotations. I will tell you about some of the problems that I encountered in the upcoming posts.

You can talk about... Object-Relational Mapping with Hibernate Core and Hibernate Annotations

Tags: • applicationlibraryjavadatabaseseohow tohibernate corehibernate annotationsrelational mappingaccess databaseaccess database object


Related articles:
Social sharing because it feels good:

PreviousContentsNext


Object-Relational Mapping with Hibernate Core and Hibernate Annotations
Webmaster and SEO

Have you added a link to us from your website? (2254785111):
  • <a href="http://article-library.webmasterjrseo.com">Webmaster and SEO</a>
  • <a href="http://article-library.webmasterjrseo.com/relational_mapping">Object-Relational Mapping with Hibernate Core and Hibernate Annotations (relational mapping); Webmaster and SEO </a>
Object-Relational Mapping with Hibernate Core and Hibernate Annotations (relational mapping); Webmaster and SEO Copyright (c) 2008-2011 GLR Sales LLC.
(rozwqizwipzetw)

Privacy & DMCA Policy -- Sitemap
relational mapping Object-Relational Mapping with Hibernate Core and Hibernate Annotations