|
Home Webmaster and SEO Forum Home |
Object-Relational Mapping with Hibernate Core and Hibernate AnnotationsAll listings are the responsiblity of the posters; keep in mind, anyone can post anything! |
![]() us |
|
| ||
Webmaster and SEOObject-Relational Mapping with Hibernate Core and Hibernate Annotations
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: • application • library • java • database • seo • how to • hibernate core • hibernate annotations • relational mapping • access database • access database object • Related articles:
Object-Relational Mapping with Hibernate Core and Hibernate Annotations Webmaster and SEO |
Have you added a link to us from your website? (2254785111):
(rozwqizwipzetw) Privacy & DMCA Policy -- Sitemap |