For the past two decades, Hibernate, a cornerstone of Java data persistence, has thrived under the stewardship of JBoss and Red Hat. Today, the project announces a significant shift: its move to the Commonhaus Foundation, a neutral ground for open-source projects.
Hibernate configuration
Configuring Composite Primary key in JPA applications
Composite keys are a group of columns in the database, whose values together make a unique value. When using Hibernate or JPA applications there are two main strategies to map a Composite Primary Key. Mapping a Composite key with an @IdClass The name of the class is indicated as the value of the class attribute … Read more
Configure Hibernate Connection Pool
This article discusses how to configure a JDBC Connection Pool in Hibernate applications covering both Hibernate managed applications and Hibernate Native applications.
How do I enable statistics with Hibernate and JPA?
You can enable Hibernate statistics by setting the property hibernate.generate_statistics in the persistence.xml of your application: <property name=”hibernate.generate_statistics”>true</property> For Hibernate native application, you need to include the above property in hibernate.cfg.xml After deploying the application, you will see in your server logs the following statistics when the Hibernate session is closed: 18:16:30,502 INFO [org.hibernate.engine.internal.StatisticalLoggingSessionEventListener] (default … Read more
Hibernate fetching performance tuning
Joining tables in SQL is the foundation of a relational database, as joins allow you to actually model relationships between tables. In plain JDBC, joins between tables are composed using native SQL statements. On the other hand, when using Hibernate/JPA this is greatly simplified as you will specify the relation between tables in terms of … Read more