Fading Coder

One Final Commit for the Last Sprint

Entity Framework: Data Mapping, Query Execution, and State Management Techniques

Data Annotation Attributes for Schema Configuraton [Table("Products")] public class Product { [Key] [Column("ProductKey")] [DatabaseGenerated(DatabaseGeneratedOption.Identity)] public int ProductKey { get; set; } [Required] [StringLength(100)] public string ProductName { get; set...

MyBatis Annotation-Based Development: A Comprehensive Guide

Introduction to MyBatis Annotation Development MyBatis annotation-based development has become the preferred approach in modern Java projects, particularly those built with Spring Boot. This method allows developers to bypass the cumbersome XML configuration files and write data access layers in a m...

Implementing Complex Types in Entity Framework Code First

In Entity Framwork (EF) Code First development, a Complex Type is a class that serves as a container for properties but lacks its own identity (i.e., it does not have a primary key). Unlike standard entity types, complex types are not mapped to their own database tables. Instead, their properties ar...

MyBatis Core Configuration and Mapping Techniques

Project Dependencies To begin using MyBatis with MySQL, add the following libraries to your build: <dependency> <groupId>org.mybatis</groupId> <artifactId>mybatis</artifactId> <version>3.5.9</version> </dependency> <dependency> <groupId>mys...

MyBatis Custom Parameter Mapping Techniques

Handling Column-to-Property Mapping in MyBatis When working with MyBatis, a common challenge arises when mapping database columns to Java entity properties. Database tables typicallly use snake_case naming (like emp_name), while Java POJOs follow camelCase convenitons (like empName). This article ex...

Understanding Hibernate's get() and load() Methods for Object Retrieval

Hibernate provides two primary methods for retrieving objects from a database: session.get() and session.load(). These methods differ significantly in their loading behavior and performance characteristics. Load Method Behavior The load() method employs lazy loading. When envoked, it returns a proxy...

Retrieving Auto-Generated Keys in MyBatis

In database operations, we often need to retrieve auto-generated primary key values after inserting records. MyBatis provides two approaches to accomplish this: using the useGeneratedKeys attribute and the selectKey element. Using useGeneratedKeys Attribute The useGeneratedKeys attribute enables aut...

Building a Minimalistic MyBatis Implementation

Introduction MyBatis serves as a persistence framework that simplifies database operations by eliminating repetitive tasks associated with traditional JDBC usage. It allows developers to focus more on business logic rather than boilerplate code, offering flexible SQL construction and result mapping...

Deep Dive: Design Patterns Within Mybatis Source Code

Understanding design patterns theoretically often differs from observing their practical application in large-scale frameworks. While there are 23 standard patterns, developers frequently encounter them more clearly within mature source codebases like Mybatis. Analyzing these internals reveals how c...

Getting Started with MyBatis: Building Your First Application

Understanding Frameworks A framework is a reusable design structure that defines the architecture of an application, outlining dependencies, responsibilities, and control flow among components. It serves as a foundation upon which developers build applications, abstracting common functionalities to...