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
Optimizing Database Design and Query Performance in Affiliate Rebate Systems
In affiliate rebate platforms—where high-volume transactions, real-time commission tracking, and user activity logs are common—database efficiency directly impacts system scalability and responsiveness. Optimizing both schema design and data access patterns is essential to maintain performance under load.
Schema Design Best Practices
A well-str ...
Posted on Wed, 13 May 2026 09:19:28 +0000 by gtrufitt
Hibernate Multi-Table Join Query Annotations: Understanding Foreign Key Column Mapping
This discussion focuses on Hibernate annotation-based multi-table join queries, particularly addressing parameter configuration when primary and foreign key field names differ between tables.
Development Environment and Scope
Annotation-based Hibernate multi-table join implementations
Using IntelliJ IDEA development environment
Covers scenario ...
Posted on Mon, 11 May 2026 07:36:25 +0000 by backinblack