SupportWriter space ↗
REFERENCE LIBRARY

References from other publishers

Republished articles with source attribution. This collection is separate from Diary Coding’s original guides and does not display ads.

Read original guides → · Editorial policy

FOR YOUR CURIOSITY

Latest notes.

HIBERNATE / NOTES</>↗
Hibernate15 Jun 2025

How do I use @Embeddable and @Embedded classes in Hibernate?

In Hibernate (or JPA in general), the @Embeddable and @Embedded annotations are used to help manage object-relational mapping for complex types (value types) within entities. These annotations allow you to define reusable and nested objects that don’t require their own database table but are saved as part of the owning entity. Here’s how to use […]

Wayan · 5 min read
HIBERNATE / NOTES</>↗
Hibernate14 Jun 2025

How do I handle lazy vs eager fetching in Hibernate mappings?

In Hibernate (and JPA), fetching strategies (lazy and eager) control how related entities are loaded from the database. Understanding how to use these strategies effectively is essential for optimizing application performance. Here’s what you need to know: 1. Eager Fetching Definition: When a relationship is marked as eager, Hibernate retrieves the related entity or collection […]

Wayan · 4 min read
HIBERNATE / NOTES</>↗
Hibernate13 Jun 2025

How do I enable and use Hibernate’s second-level cache with EHCache?

To integrate Hibernate’s second-level cache with EHCache, follow these steps: Step 1: Add Dependencies Ensure that you have the required dependencies in your project: For Maven: <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-core</artifactId> <version>6.4.4.Final</version> </dependency> <dependency> <groupId>org.ehcache</groupId> <artifactId>ehcache</artifactId> <version>3.10.8</version> </dependency> <dependency> <groupId>org.hibernate</groupId> <artifac...

Wayan · 4 min read
HIBERNATE / NOTES</>↗
Hibernate13 Jun 2025

How do I map a one-to-many relationship using Hibernate annotations?

In Hibernate, you can use the @OneToMany and @ManyToOne annotations to map a one-to-many relationship. Below is a step-by-step explanation with an example: Explanation: One-To-Many Side: Use the @OneToMany annotation on the field representing the collection in the parent entity. Typically, this will be a List, Set, or other collection type. Many-To-One Side: Use the […]

Wayan · 3 min read
HIBERNATE / NOTES</>↗
Hibernate12 Jun 2025

How do I handle database connections in a Hibernate standalone application?

To handle database connections in a Hibernate standalone application, you need to set up Hibernate configuration carefully and ensure the correct management of the Hibernate SessionFactory and Session objects. Below are the general steps to achieve this: Steps to Handle Database Connections in Hibernate Standalone Application 1. Add Required Hibernate Dependencies Ensure you include the […]

Wayan · 4 min read
HIBERNATE / NOTES</>↗
Hibernate12 Jun 2025

How do I define a primary key with @Id and @GeneratedValue in Hibernate?

Defining a primary key using the @Id and @GeneratedValue annotations in Hibernate (or JPA) is straightforward and commonly used to automate primary key generation for database entities. Here’s a guide: Steps: Use @Id annotation: Marks a field in your entity class as the primary key. Use @GeneratedValue annotation: Specifies that the primary key values should […]

Wayan · 2 min read
✳

Knowledge grows when shared.

Stay curious. There is always something new to learn.

Explore notes ↗
Putu Adi Guna Permana
ABOUT THE AUTHOR

Dr (C). Ir. Putu Adi Guna Permana, S.Kom., M.Kom., IPM., ASEAN Eng.

Writer and founder of Diary Coding — sharing notes, tutorials, and experiences about programming for anyone who wants to keep learning.