Spring Data JPA: Mapping Objects and Databases

Spring Data JPA JPA (Jakarta Persistence API) is an official Java persistence specification, not a concrete implementation framework. Spring Data JPA is an implementation that builds on top of JPA, with Hibernate as the underlying engine. It eliminates the need to repeatedly write CRUD code; simple operations require no SQL statements. Further ...

Posted on Sun, 20 Sep 2026 16:55:24 +0000 by FVxSF

Essential Hibernate Annotations for Entity Mapping

Core Entity Mapping Annotations @Entity Marks a class as a persistent entity. Without parameters, the table name matches the class name. Use @Entity(name="custom_table") to override the default table name. @Table Specifies the database table name for an entity: @Table(name="user_data") @Id and @GeneratedValue Defines the pri ...

Posted on Fri, 11 Sep 2026 16:55:33 +0000 by merck_delmoro

SSH Framework Implementation Guide

SSH Framework Implementation Guide Project Framework Setup: Create Control Project Required JAR Packages: db: Database connection driver hibernate: Hibernate framework libraries jstl: Java Standard Tag Library junit: Testing framework spring: Spring framework libraries struts2: Struts2 framework libraries Project Layer Structure: com.tech. ...

Posted on Fri, 28 Aug 2026 16:51:05 +0000 by zizzy80

Understanding JDBC as a Foundation for MyBatis

Setting Up a Maven Project Begin by creating a new Maven project in your IDE. Configure the project with the following details: GroupId: com.example.persistence ArtifactId: PersistenceDemo Version: 1.0-SNAPSHOT Adding MySQL Dependencies In your pom.xml file, include the MySQL connector dependency: <dependencies> <dependency> ...

Posted on Thu, 30 Jul 2026 16:56:18 +0000 by thewooleymammoth

Implementing the DAO Layer in the SSH Framework

Creating a Generic DAO Interface To avoid repetitive code for common database operations, it's effective to define a generic Data Access Object (DAO) interface. This interface will declare methods that are applicable to any entity. package com.example.ssh.dao; /** * A generic interface for basic CRUD operations on any entity type. * @param ...

Posted on Fri, 17 Jul 2026 17:21:29 +0000 by slightlyeskew

Customizing Physical Table and Column Names in Hibernate

When working with a databsae that enforces consistent naming conventions—such as prefixing all table and columns with ycx_—manually annotating every entity and field using @Table and @Column becomes impractical for large schemas. A more scalable solution is to implement Hibernate’s PhysicalNamingStrategy interface to apply naming rules globally ...

Posted on Fri, 17 Jul 2026 16:31:15 +0000 by Ellen67

Implementing Persistence Layer in SSH Framework

Define a domain model class that represents database table structure: package com.example.elec.domain; import java.io.Serializable; import java.util.Date; public class DeviceLog implements Serializable { private String logId; private String deviceName; private Date logDate; private String description; // Accessor meth ...

Posted on Wed, 15 Jul 2026 16:54:56 +0000 by drranch

Handling MySQL Foreign Key Constraint Violations During Record Deletion

Understanding the Constraint Error When attempting to remove records from a parent table, developers frequently encounter the following MySQL exception: ERROR 1451 (23000): Cannot delete or update a parent row: a foreign key constraint fails (database.table_name, CONSTRAINT fk_name FOREIGN KEY (child_col) REFERENCES parent_table(id)) This erro ...

Posted on Sat, 11 Jul 2026 16:47:42 +0000 by markuatcm

Building a RESTful API with Spring Boot: From Database to Endpoints

Spring Boot REST API Implemantation Project Configuration Spring Setup The project is initialized using Spring Initializr at https://start.spring.io/. The following properties are configured in the application.properties file: spring.datasource.url=jdbc:mysql://localhost:3306/personnel_directory spring.datasource.username=admin spring.datasourc ...

Posted on Sun, 05 Jul 2026 16:26:11 +0000 by j3rmain3

Handling Empty Values in Database Update Utility Classes

When working with Hibernate in projects, we often need generic database operation classes. While Tk MyBatis provides convenient utilities with methods that only update non-null values, empty strings are still processed as valid updates. This article presents a utility solution for converting empty strings to null values, along with a custom ann ...

Posted on Thu, 28 May 2026 20:45:17 +0000 by rjlowe