Ruang penulis
SEBUAH JURNAL TENTANG TEKNOLOGI

Belajar hal baru.
Tulis. Bagikan.

Ruang untuk merangkai pengetahuan, satu baris kode setiap hari.
Temukan tutorial, ide, dan catatan dari perjalanan belajar.

1914 catatan & terus bertumbuh
PILIHAN EDITOR
Java

Memahami Java Stream: olah koleksi dengan lebih ringkas

Pelajari alur filter, map, dan collect untuk mengolah data Java dengan kode yang mudah dibaca.

D Tim Diary Coding · 1 menit baca
UNTUK RASA INGIN TAHUMU

Catatan terbaru.

HIBERNATE / CATATAN</>
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 menit baca
HIBERNATE / CATATAN</>
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 menit baca
HIBERNATE / CATATAN</>
Hibernate11 Jun 2025

How do I write a simple JPQL query using Hibernate?

To write a simple JPQL (Java Persistence Query Language) query using Hibernate, follow these steps: Example: Basic JPQL Query For example, consider we have an entity: Employee package org.kodejava.hibernate; import jakarta.persistence.Entity; import jakarta.persistence.Id; import jakarta.persistence.Table; @Entity @Table(name = "employee") public class Employee { @Id private Long id; private String name; private String department; private Double […]

Wayan · 3 menit baca
HIBERNATE / CATATAN</>
Hibernate11 Jun 2025

How do I configure Hibernate with an H2 in-memory database?

Configuring Hibernate with an H2 in-memory database is quite straightforward. Below is a guide for configuring Hibernate with an H2 database in a Spring Boot or standalone Jakarta EE project. Configuration for Hibernate with H2 in-memory database 1. Add Dependencies Ensure you have the necessary dependencies in your project. For a Maven project, include the […]

Wayan · 4 menit baca
HIBERNATE / CATATAN</>
Hibernate10 Jun 2025

How do I use SessionFactory and Session in Hibernate 6?

Hibernate ORM 6 introduces several changes to its API compared to previous versions, especially in how SessionFactory and Session are used due to compliance with Jakarta EE and its updated imports (jakarta.persistence.*). Here’s a simple guide to using SessionFactory and Session in Hibernate 6: 1. Add Hibernate Dependencies Make sure to include the Hibernate 6 […]

Wayan · 5 menit baca
HIBERNATE / CATATAN</>
Hibernate10 Jun 2025

How do I map a Java class to a database table using JPA annotations?

To map a Java class to a database table using JPA annotations, you primarily use annotations provided by jakarta.persistence. Here is a step-by-step guide: Key annotations for mapping: @Entity Marks the class as an entity that is mapped to a table. @Table (optional) Specifies the table name in the database. If omitted, the default table […]

Wayan · 3 menit baca

Pengetahuan tumbuh ketika dibagikan.

Simpan rasa ingin tahu. Selalu ada hal baru untuk dipelajari.

Jelajahi catatan ↗
Putu Adi Guna Permana
TENTANG PENULIS

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

Penulis dan pendiri Diary Coding — berbagi catatan, tutorial, dan pengalaman seputar pemrograman untuk siapa pun yang ingin terus belajar.