HIBERNATE / CATATAN</>↗Hibernate09 Jun 2025
Basic CRUD operations with Hibernate 6 involve creating, reading, updating, and deleting records in a database using Hibernate ORM. Hibernate simplifies these operations through its API. Below is an explanation of each CRUD operation along with corresponding examples: 1. Create (Insert) To save a new object in the database, you use the persist() or save() […]
HIBERNATE / CATATAN</>↗Hibernate09 Jun 2025
To configure hibernate.cfg.xml for a simple Hibernate application, you need to include the essential properties for Hibernate to interact with the database and map your entities. Below is an example of hibernate.cfg.xml: <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> <hibernate-configuration> <session-factory> <!– Database connection settings –> <property name="hib...
HIBERNATE / CATATAN</>↗Hibernate08 Jun 2025
To create a basic Hibernate entity using annotations, follow these steps: 1. Add Required Dependencies Ensure you have added the required dependencies for Hibernate, JPA (jakarta.persistence), and any database (e.g., H2 for testing) in your pom.xml. For example: <dependencies> <!– Hibernate Core –> <dependency> <groupId>org.hibernate.orm</groupId> <artifactId>hibernate-core</artifactId> <version>6.4.4.Final</version> </dependency> <!– H2 Database –> <dependency> <groupId>com....
JPOS / CATATAN</>↗jPOS08 Jun 2025
Setting up JPOS in a Java project to handle ISO 8583 messaging involves configuring a robust library used for financial message processing. Here’s a step-by-step guide to integrate and configure JPOS in your Java project: Step 1: Setup an ISO 8583 Configuration File Create an ISO 8583 configuration file (e.g., iso8583.xml) in your project. This […]
KOTLIN / CATATAN</>↗Kotlin07 Jun 2025
In Kotlin, reified types are used with inline functions to enable type information to be available at runtime. Normally, type parameters in generics are erased at runtime due to type erasure, but reified allows the type to remain available for reflective operations or type-specific logic. Here are the key points to use reified types with […]
KOTLIN / CATATAN</>↗Kotlin07 Jun 2025
In Kotlin, you can use tail recursion to optimize recursive functions by preventing stack overflow and enabling a more optimized execution during runtime. A tail-recursive function is one where the recursive call is the last operation performed in the function. To achieve this, Kotlin provides the tailrec modifier, which instructs the compiler to optimize the […]