The minimal configuration for testing Hibernate
In my previous post I announced my intention of creating a personal Hibernate course. The first thing to start with is a minimal testing configuration. The examples are relevant for Hibernate 4. In a real production environment you won’t use Hibernate alone, as you may integrate it in a JEE or Spring container. For testing Hibernate features you don’t need a full-blown framework stack, you can simply rely on Hibernate flexible configuration options.
Hibernate one-to-one mapping using annotations
If you are working on any hibernate project or you are planning to work on any in future, then you can easily understand the one-to-one relationships between several entities in your application. In this post, i will discuss variations of one-to-one mappings supported in hibernate.
Hibernate 3 introduction and writing hello world application
Hibernate was started in 2001 by Gavin King as an alternative to using EJB2-style entity beans. Its mission back then was to simply offer better persistence capabilities than offered by EJB2 by simplifying the complexities and allowing for missing features. Hibernate used its mapping files and configuration files to achieve its objectives. With the introduction of annotations in java community with JDK 1.5, Hibernate community started working on Hibernate 3, which has support for annotations.
Hibernate Example using Hibernate Tools
Learn how to create a simple example using the Eclipse IDE and Hibernate Tools plug-in.
Hibernate Inheritance: Table Per Class Hierarchy (Annotation & XML Mapping)
Welcome to Hibernate Tutorial Series. In previous tutorials we saw how to implement Relationship Mapping in Hibernate. We saw different mapping techniques like One to Many, Many to Many using both Annotations and XML mapping. Today we will see how the Inheritance is managed in Hibernate. You may want to look at previous tutorials. Here is the complete list for you.
Developing Applications with JBoss and Hibernate
Developers will be introduced to Hibernate and learn to build Java classes and map files from scratch. They will also learn to reverse engineer the database schema into Java classes and Hibernate mapping files and build a web application that will be able to interact with the Hibernate POJOs which they will later deploy to JBoss AS.
Hibernate insert query tutorial
Hibernate is an object-relational mapping (ORM) library for the Java language, providing a framework for mapping an object-oriented domain model to a traditional relational database. This means you are not required to build and execute SQL queries for interaction with database. You just have to instruct hibernate for that by calling hibernate APIs and hibernate will create and execute those SQL queries on behalf of you. In this tutorial, I am giving example of inserting data in a single table. We have an object in application i.e. Employee. We want to store it in database. It has following attributes...
Batch insert in Hibernate
This example program shows how to insert multiple rows using the batch processing in hibernate. when there are thousand of rows to be persisted, everytime iterating and inserting will cause the memory problem. Hibernate stores all the persisted objects in the memory. To avoid this problem use batch processing in the hibernate.
Hibernate 4 example to get entity reference for lazy loading
By Wikipedia definition, Lazy loading is a design pattern commonly used in computer programming to defer initialization of an object until the point at which it is needed. We know that in hibernate lazy loading can be done by specifying “fetch= FetchType.LAZY” in hibernate mapping annotations.
Hibernate EhCache configuration tutorial
Caching is facility provided by ORM frameworks which help users to get fast running web application, while help framework itself to reduce number of queries made to database in a single transaction. Hibernate also provide this caching functionality, in two layers. In this tutorial, I am giving an example using ehcache configuration as second level cache in hibernate.
Hibernate hidden Gem: the pooled-lo optimizer
Hibernate offers a new class of identifier generators, addressing many shortcomings of the original ones. The enhanced identifier generators don’t come with a fixed identifier allocation strategy. The optimization strategy is configurable and we can even supply our own optimization implementation. By default Hibernate comes with the following built-in optimizers:
What is hibernate in Java? This tutorial will explain how to Hibernate.
Understanding hibernate first level cache with example
Caching is a facility provided by ORM frameworks which help users to get fast running web application, while help framework itself to reduce number of queries made to database in a single transaction. Hibernate achieves the second goal by implementing first level cache. Fist level cache in hibernate is enabled by default and you do not need to do anything to get this functionality working. In fact, you can not disable it even forcefully.
A beginner's guide to Hibernate types
When learning Hibernate many like to jump to parent-child associations without mastering the object relation mapping basics. It’s very important to understand the basic mapping rules for individual Entities before starting modelling Entity associations. A Hibernate type is a bridge between an SQL type and a Java primitive/Object type.
Hibernate: @JoinTable with intermediary table
There are a lot of articles about Hibernate associations in the internet and particularly on my blog. But JPA provides numerous combinations of associations, so it’s not strange that we still see new posts about this or that kind of association. Today I want to examine situation with the @JoinTable annotation and intermediary table. For the tutorial I’ll use MySQL, Hibernate as implementation of JPA and Maven.
Struts Hibernate Integration
Learn how the Web Framework Struts and the Database Persistence Solution Hibernate can be used together.
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.
A beginner's guide to JPA/Hibernate entity state transitions
Hibernate shifts the developer mindset from SQL statements to entity state transitions. Once an entity is actively managed by Hibernate, all changes are going to be automatically propagated to the database.Manipulating domain model entities (along with their associations) is much easier than writing and maintaining SQL statements. Without an ORM tool, adding a new column requires modifying all associated INSERT/UPDATE statements.
Integrate JavaFX, Hibernate and PostgreSQL with the MVC Pattern
JavaFX provides a rich set of UI controls, which simplify the development of visually immersive front ends for database-driven applications. When combined with the PostgreSQL database and the Hibernate ORM tool, JavaFX can handle the presentation layer for large-scale, data-driven business applications (JavaFX PostgreSQL) as well as robust desktop applications (JavaFX Hibernate).
Tutorial Using the Java Persistence API (JPA)
The previous tutorials used the Hibernate-specific hibernate.cfg.xml configuration file. JPA, however, defines a different bootstrap process that uses its own configuration file named persistence.xml. How this bootstrapping works is defined by the JPA specification. In Java™ SE environments the persistence provider (Hibernate in this case) is required to locate all JPA configuration files by classpath lookup of the META-INF/persistence.xml resource name.