Saturday 21 July 2018

Hibernate Extravaganza - 7 Tutorials to kick-start your projects

Facebook
Twitter
LinkedIn
Google Plus
Email
Java Code Geeks on Steroids

7 Hibernate Tutorials to kick-start your projects


Tutorial: Hibernate, JPA
This is the first part of tutorial about using Hibernate and JPA. This part is an introduction to to JPA and Hibernate. The second part will look at putting together a Spring MVC application using Spring ORM to reduce the amount of code necessary to create a CRUD application.  To complete this you'll want to be familiar with Maven, JUnit, SQL and relational databases.

Hibernate cache levels tutorial
One of the common problems of people that start using Hibernate is performance, if you don't have much experience in Hibernate you will find how quickly your application becomes slow. If you enable sql traces, you would see how many queries are sent to database that can be avoided with little Hibernate knowledge. In current post I am going to explain how to use Hibernate Query Cache to avoid amount of traffic between your application and database.

Hibernate mapped collections performance problems
First things first, this article was inspired after Burt Beckwith's presentation about Advanced GORM – Performance, Customization and Monitoring at SpringOne 2GX on Jan 27, 2011. In short, Burt Beckwith discusses potential performance problems using mapped collections and Hibernate 2nd-level cache in GORM, along with strategies for avoiding such performance penalties.

JPA 2.0 Criteria Query with Hibernate
Criteria Query has been introduced in JPA 2.0. With the help of criteria queries you can write your queries in a type-safe way. Before criteria queries, developers had to write queries through the construction of object-based query definitions. There might be chances of incorrect syntax while building the queries. The criteria query API provides feature to create structured and nested queries with compile time safety. Getting into more theory about criteria query may not be a good idea as there are plethora of pages can be found on net for same.

Hibernate Performance Tips: Dirty Collection Effect
Last year I went to Devoxx as speaker but also I attended Patrycja Wegrzynowicz conference about Hibernate Anti-Patterns. In that presentation Patrycja shows us an anti-pattern that shocks me because it proved to expect the unexpected. We are going to see the effect it has when Hibernate detects a dirty collection and should re-create it.

Schema Creation Script With Hibernate 4, JPA And Maven
The scenario is trivial – you want to generate a database schema creation script while building your application (and then execute the script on the target database) This was relatively easy with Hibernate 3, as there was the hibernate3-maven-plugin, but it is not compatible with Hibernate 4. And for every new project you should start with Hibernate 4, of course. So what to do? It's relatively simple, but takes some time to research and test. The idea is to use the SchemaExport tool. But it's a bit tricky, because it only supports native Hibernate configuration and not JPA.

Hibernate: DDL Schema generation
Not so long time ago I have to work with in-memory database. This activity was related to integration testing. As you know, it is a normal practice to use in-memory data bases for the integration testing. There are several reasons for this: portability, well grained environment infrastructure, high performance, consistency of original data base. The problem is a coppying of production DDL schemas into testing in-memory data base. The first one is MySQL, the second one is HSQLDB. A syntax of MySQL distinct from HSQL syntax. Therefore importing of MySQL table schemas into HSQLDB becomes impossible without an appropriate converting.

Till the next time, enjoy...!!
Your Suggestions
Any ideas or suggestions? Shoot us an email at newsletter@javacodegeeks.com
Copyright © 2018 Exelixis Media P.C., All rights reserved.
You are receiving this email because you opted in at our website(s) www.javacodegeeks.com, examples.javacodegeeks.com

Our mailing address is:
Exelixis Media P.C.
Nafpaktias 18
Kesariani, Attica 16121
Greece

Add us to your address book
unsubscribe from this list    update subscription preferences

No comments:

Post a Comment