Tagged articles

MyBatis

762 articles · Page 8 of 8
Java Backend Technology
Java Backend Technology
Oct 26, 2019 · Backend Development

15 Essential Java Backend Coding Practices to Boost Performance

This article presents fifteen practical Java backend coding guidelines—including avoiding "where 1=1" in MyBatis, iterating Map entrySet, using Collection.isEmpty, pre‑sizing collections, employing StringBuilder, preferring Set for contains checks, initializing static members correctly, removing dead code, shielding utility constructors, eliminating redundant catches, using String.valueOf, avoiding BigDecimal(double), returning empty collections, calling equals on constants, securing enum fields, and escaping regex in split—each illustrated with bad and good code examples to improve readability, safety, and efficiency.

CollectionsMyBatisbackend
0 likes · 16 min read
15 Essential Java Backend Coding Practices to Boost Performance
21CTO
21CTO
Oct 21, 2019 · Backend Development

Boost Java Performance: 16 Proven Coding Practices You Should Adopt

This article presents sixteen practical Java coding guidelines—ranging from avoiding "where 1=1" in MyBatis to using static blocks for collection initialization, preferring Set over List for contains checks, and returning empty collections instead of null—to help developers write more efficient, readable, and safe backend code.

CollectionsMyBatisbackend development
0 likes · 17 min read
Boost Java Performance: 16 Proven Coding Practices You Should Adopt
Architect's Tech Stack
Architect's Tech Stack
Sep 20, 2019 · Backend Development

Design Patterns in MyBatis: Builder, Factory, Singleton, Proxy, Composite, Template Method, Adapter, Decorator, Iterator

This article examines how MyBatis applies classic design patterns—including Builder, Factory, Singleton, Proxy, Composite, Template Method, Adapter, Decorator, and Iterator—by analysing source code snippets and explaining each pattern's role in the framework's configuration, execution, caching, and dynamic SQL generation.

Design PatternsMyBatisbackend development
0 likes · 18 min read
Design Patterns in MyBatis: Builder, Factory, Singleton, Proxy, Composite, Template Method, Adapter, Decorator, Iterator
Alibaba Cloud Developer
Alibaba Cloud Developer
Sep 18, 2019 · Backend Development

Boost Your Coding Speed: 6 Proven Code‑Generation Techniques

This article explores six practical ways to accelerate Java development—from hand‑writing and copy‑pasting to Excel formulas, code‑generation tools, and custom generators—detailing their workflows, sample code, advantages, drawbacks, and how to choose the right method for any project.

MyBatiscode generationproductivity
0 likes · 15 min read
Boost Your Coding Speed: 6 Proven Code‑Generation Techniques
Programmer DD
Programmer DD
Aug 8, 2019 · Databases

How to Quickly Set Up H2 Embedded Database with SpringBoot and MyBatis

This article explains the lightweight features of the pure‑Java H2 embedded database, demonstrates its various modes—including in‑memory, file‑based, and standalone server—and provides step‑by‑step integration with SpringBoot and MyBatis for rapid development and testing.

Embedded DatabaseMyBatisSpringBoot
0 likes · 9 min read
How to Quickly Set Up H2 Embedded Database with SpringBoot and MyBatis
Programmer DD
Programmer DD
Aug 4, 2019 · Backend Development

Master MyBatis TypeHandler: Elegant Enum Mapping and Custom Handlers

Learn how to replace fragile numeric status codes with clean enum handling in Java using MyBatis TypeHandler, explore built‑in handlers like EnumOrdinalTypeHandler and EnumTypeHandler, and create custom handlers for seamless database‑Java type conversion, complete with configuration tips and practical examples.

EnumMyBatisORM
0 likes · 9 min read
Master MyBatis TypeHandler: Elegant Enum Mapping and Custom Handlers
FunTester
FunTester
Jul 27, 2019 · Backend Development

How to Build an Asynchronous MySQL Storage Service with Spring Boot & MyBatis

This article walks through rebuilding an asynchronous MySQL logging service using Spring Boot and MyBatis, providing full source code for the application entry point, DAO, service, controller, MyBatis mapper, and configuration, and shows the resulting database entries.

Async StorageMyBatisMySQL
0 likes · 5 min read
How to Build an Asynchronous MySQL Storage Service with Spring Boot & MyBatis
macrozheng
macrozheng
Jun 21, 2019 · Backend Development

Fix MyBatis Generator XML Append Issue: Overwrite Mapper Files Correctly

This guide explains why MyBatis Generator appends to existing mapper.xml files causing duplicate BaseResultMap errors, and shows how to upgrade to version 1.3.7 and add the UnmergeableXmlMappersPlugin to ensure mapper files are overwritten and the application runs smoothly.

MyBatisXMLbackend
0 likes · 4 min read
Fix MyBatis Generator XML Append Issue: Overwrite Mapper Files Correctly
Programmer DD
Programmer DD
Jun 9, 2019 · Backend Development

Inside MyBatis: How SqlSessionFactory, Executor, and Mappers Work Together

This article walks through MyBatis' internal workflow—from parsing the global XML configuration and building the SqlSessionFactory, to creating a SqlSession, executing a query via the Executor, handling caching, and finally mapping results—illustrated with key code snippets and a diagram.

ExecutorMyBatisORM
0 likes · 16 min read
Inside MyBatis: How SqlSessionFactory, Executor, and Mappers Work Together
Programmer DD
Programmer DD
May 29, 2019 · Backend Development

MyBatis Pitfalls and Best Practices: A Guide for Java Developers

Discover the most common MyBatis pitfalls—from # vs $ usage, handling nulls, resultMap quirks, and dynamic SQL issues—to master safe query practices, optimize performance, and avoid runtime errors, while comparing its strengths and weaknesses against Hibernate for effective Java backend development.

MyBatisORMSQL
0 likes · 23 min read
MyBatis Pitfalls and Best Practices: A Guide for Java Developers
Programmer DD
Programmer DD
May 15, 2019 · Backend Development

Why MyBatis Runs Extra SQLs and How to Tune Its Cache

This article explains why MyBatis may execute unexpected additional SQL statements, reveals the default caching behavior, shows the required XML configuration and Serializable implementation, and offers practical steps to prevent cache clearing on inserts for more efficient backend data access.

MyBatisORMSQL
0 likes · 3 min read
Why MyBatis Runs Extra SQLs and How to Tune Its Cache
Java Captain
Java Captain
May 6, 2019 · Backend Development

Introduction to Spring Boot with Code Examples

This article provides a comprehensive tutorial on Spring Boot, covering its purpose, key advantages, project setup with Maven, essential configuration files, integration of JdbcTemplate, JPA, MyBatis, JSP, AOP, and task scheduling, all illustrated with complete Java code snippets.

AOPJPAMaven
0 likes · 12 min read
Introduction to Spring Boot with Code Examples
macrozheng
macrozheng
May 4, 2019 · Backend Development

Explore the Full‑Featured Mall E‑Commerce System Built with Spring Boot & MyBatis

The Mall project is a comprehensive e‑commerce solution featuring a front‑end storefront and back‑office management, implemented with Spring Boot, MyBatis, and a suite of modern technologies such as Redis, Elasticsearch, RabbitMQ, Docker, and more, offering modules for products, orders, marketing, and analytics.

DockerElasticsearchMyBatis
0 likes · 4 min read
Explore the Full‑Featured Mall E‑Commerce System Built with Spring Boot & MyBatis
Senior Brother's Insights
Senior Brother's Insights
Apr 15, 2019 · Backend Development

How MyBatis Implements 9 Classic Design Patterns – A Deep Dive

This article explores how MyBatis applies nine fundamental design patterns—including Builder, Factory, Singleton, Proxy, Composite, Template Method, Adapter, Decorator, and Iterator—by examining its source code, illustrating each pattern with explanations and concrete code snippets to deepen developers' understanding of real‑world pattern usage.

BuilderDesign PatternsMyBatis
0 likes · 19 min read
How MyBatis Implements 9 Classic Design Patterns – A Deep Dive
Java Captain
Java Captain
Apr 6, 2019 · Backend Development

MyBatis Q&A: #{} vs ${}, Pagination Techniques, Caching, Lazy Loading, Executors, and Custom Plugin Development

This article explains MyBatis fundamentals including the difference between #{} and ${} placeholders, various pagination approaches, logical versus physical pagination, first‑ and second‑level caching, lazy‑loading mechanisms, executor types, pagination plugin principles, and how to create a custom MyBatis plugin with code examples.

MyBatisSQLbackend development
0 likes · 8 min read
MyBatis Q&A: #{} vs ${}, Pagination Techniques, Caching, Lazy Loading, Executors, and Custom Plugin Development
Java Captain
Java Captain
Mar 9, 2019 · Fundamentals

Understanding Java Enums: Usage, Switch Cases, Singleton Implementation, and Database Integration

This article explores Java enums in depth, covering their basic definition, typical usage patterns such as iteration and switch statements, implementing singletons, integrating with databases via MyBatis type handlers, and addressing common misconceptions about memory consumption, illustrating each concept with clear code examples.

DatabaseEnumMyBatis
0 likes · 7 min read
Understanding Java Enums: Usage, Switch Cases, Singleton Implementation, and Database Integration
Java Captain
Java Captain
Dec 30, 2018 · Backend Development

Using MyBatis3 Annotations to Replace XML Configuration: A Comprehensive Guide

This article provides a step‑by‑step tutorial on using MyBatis3 annotation‑based CRUD, mapping, and provider annotations to replace XML configuration in a Spring Boot project, covering basic annotations, result mapping, dynamic SQL, Maven dependencies, configuration files, entity classes, database scripts, controller code, and testing procedures.

CRUDMyBatisORM
0 likes · 11 min read
Using MyBatis3 Annotations to Replace XML Configuration: A Comprehensive Guide
Java Captain
Java Captain
Dec 26, 2018 · Backend Development

Understanding MyBatis Initialization: Configuration Creation and Design Patterns

This article explains the complete MyBatis initialization process, detailing how the XML configuration file is parsed into a Configuration object, how SqlSessionFactory and SqlSession are built, and highlights the Builder design pattern used throughout the setup, with code examples for manual configuration loading.

Builder PatternConfigurationInitialization
0 likes · 13 min read
Understanding MyBatis Initialization: Configuration Creation and Design Patterns
Java Captain
Java Captain
Nov 16, 2018 · Backend Development

Spring, Spring MVC, and MyBatis Interview Questions and Answers

This article compiles common interview questions and concise answers about Spring, Spring MVC, and MyBatis, covering core concepts such as IoC, AOP, transaction management, controller behavior, annotation usage, design patterns, MyBatis configuration, mapping techniques, pagination, and integration with Ajax.

InterviewMyBatisSpring
0 likes · 10 min read
Spring, Spring MVC, and MyBatis Interview Questions and Answers
Java Captain
Java Captain
Nov 5, 2018 · Backend Development

Implementing a High‑Concurrency Red Packet System with Java, MySQL, MyBatis, and Spring

This article demonstrates how to build a high‑concurrency red‑packet (抢红包) system using Java backend technologies—including MySQL table design, POJOs, MyBatis DAOs, Spring services with transaction management, and a web layer, and discusses performance testing, data consistency issues, and solutions such as pessimistic and optimistic locking.

MyBatisMySQLSpring
0 likes · 22 min read
Implementing a High‑Concurrency Red Packet System with Java, MySQL, MyBatis, and Spring
Java Captain
Java Captain
Oct 8, 2018 · Backend Development

Spring Boot Tutorial: Building a Rental Service with MyBatis Integration

This article provides a step‑by‑step guide to creating a Spring Boot application, generating a project template, adding a MyBatis‑based persistence layer, implementing service and controller layers, configuring the database, and running the application to expose REST endpoints.

MyBatisREST APISpring Boot
0 likes · 9 min read
Spring Boot Tutorial: Building a Rental Service with MyBatis Integration
Java Backend Technology
Java Backend Technology
Sep 7, 2018 · Backend Development

How MyBatis Instantiates Mapper Interfaces with JDK Dynamic Proxies

This article explains how MyBatis uses JDK dynamic proxies—specifically a custom “投鞭断流” approach—to automatically create mapper interface implementations, walks through code examples, analyzes core source files, and clarifies why method overloading is prohibited in mapper interfaces.

Dynamic ProxyMyBatisjava
0 likes · 5 min read
How MyBatis Instantiates Mapper Interfaces with JDK Dynamic Proxies
Java Captain
Java Captain
Aug 12, 2018 · Backend Development

Key Points for Building a Traditional Java Web Project: Environment Setup, DAO, Service, Controller, and Spring Integration

This article systematically outlines the essential steps and considerations for creating a classic Java web application, covering environment preparation, Maven scaffolding, logging and database dependencies, DAO design with MyBatis, Spring integration, service-layer best practices, and RESTful controller implementation.

MavenMyBatisSpring
0 likes · 9 min read
Key Points for Building a Traditional Java Web Project: Environment Setup, DAO, Service, Controller, and Spring Integration
Architect's Tech Stack
Architect's Tech Stack
Aug 12, 2018 · Backend Development

Investigating MyBatis SqlSession.clearCache() Ineffectiveness and Transaction Isolation Level Solution

Through detailed debugging and source code analysis, the author discovers that MyBatis's SqlSession.clearCache() does clear the first‑level cache, but the observed stale query results are caused by MySQL's default REPEATABLE‑READ isolation level, which can be resolved by setting the transaction isolation to READ COMMITTED.

DebuggingMyBatisSQL
0 likes · 8 min read
Investigating MyBatis SqlSession.clearCache() Ineffectiveness and Transaction Isolation Level Solution
Java Captain
Java Captain
Jul 25, 2018 · Backend Development

Integrating Alipay Payment into an SSM (Spring + Spring MVC + MyBatis) Framework

This tutorial provides a step‑by‑step guide for configuring the Alipay sandbox, generating keys, setting up the required database tables, and integrating Alipay payment APIs into a Java SSM project, complete with code snippets, configuration details, and troubleshooting tips.

AlipayMyBatisPayment Integration
0 likes · 15 min read
Integrating Alipay Payment into an SSM (Spring + Spring MVC + MyBatis) Framework
Java Captain
Java Captain
Jun 21, 2018 · Backend Development

Step-by-Step Guide to Building a Spring Boot MyBatis Demo Project

This article provides a detailed tutorial for creating a Spring Boot project with MyBatis, including environment setup, Maven dependencies, configuration files, database creation, MyBatis generator usage, and sample controller, service, and mapper code, enabling pagination with PageHelper and testing via HTTP requests.

MyBatisSpring Bootbackend development
0 likes · 14 min read
Step-by-Step Guide to Building a Spring Boot MyBatis Demo Project
Java Captain
Java Captain
Jun 18, 2018 · Backend Development

Building a Spring Boot Web Application with MyBatis and Redis Caching

This tutorial demonstrates how to quickly build a modern Java web application using Spring Boot, integrate MyBatis as the ORM, configure Redis as a second‑level cache, and write unit tests with H2, providing step‑by‑step code and configuration details for backend developers.

MyBatisRedisSpring Boot
0 likes · 17 min read
Building a Spring Boot Web Application with MyBatis and Redis Caching
Java Captain
Java Captain
Jun 2, 2018 · Backend Development

Understanding the SSM Framework: Integration of Spring MVC, Spring, and MyBatis

This article explains the SSM framework, detailing how Spring MVC, Spring, and MyBatis are integrated into a standard MVC architecture, describing their roles, underlying principles, and step‑by‑step guidance for building a functional feature with entities, mappers, services, controllers, and JSP views.

MVCMyBatisSSM
0 likes · 4 min read
Understanding the SSM Framework: Integration of Spring MVC, Spring, and MyBatis
Qunar Tech Salon
Qunar Tech Salon
May 9, 2018 · Backend Development

Resolving Spring Startup StackOverflowError Caused by @Autowired and MyBatis MapperFactoryBean

The article analyzes a StackOverflowError that occurs during Spring application startup after upgrading to JDK 8, tracing the deep bean‑creation call chain caused by extensive use of @Autowired with MyBatis MapperFactoryBean, and recommends upgrading mybatis‑spring and switching to @Resource to prevent the overflow.

AutowiredDependencyInjectionMyBatis
0 likes · 9 min read
Resolving Spring Startup StackOverflowError Caused by @Autowired and MyBatis MapperFactoryBean
Java Captain
Java Captain
Apr 24, 2018 · Backend Development

Getting Started with MyBatis: Understanding the Framework, Configuration, and CRUD Example in Java

This article introduces MyBatis as a lightweight persistence framework for Java, explains its history and core concepts, compares it with Hibernate, and provides a step‑by‑step guide with configuration files, entity classes, mapper interfaces, XML mappings, utility classes, and a test service to perform basic CRUD operations.

CRUDMyBatisORM
0 likes · 14 min read
Getting Started with MyBatis: Understanding the Framework, Configuration, and CRUD Example in Java
Java Captain
Java Captain
Apr 23, 2018 · Backend Development

Overview of Common Java Backend Technologies: Spring MVC, Spring, MyBatis, Dubbo, Maven, RabbitMQ, Log4j, Ehcache, Redis, Shiro, and Design Patterns

This article provides a comprehensive introduction to essential Java backend technologies—including Spring MVC, Spring IoC/AOP, MyBatis, Dubbo, Maven, RabbitMQ, Log4j, Ehcache, Redis, Shiro—and outlines basic design‑pattern concepts, helping developers understand their roles, core mechanisms, and practical usage.

Design PatternsDubboMyBatis
0 likes · 13 min read
Overview of Common Java Backend Technologies: Spring MVC, Spring, MyBatis, Dubbo, Maven, RabbitMQ, Log4j, Ehcache, Redis, Shiro, and Design Patterns
Java Captain
Java Captain
Apr 5, 2018 · Backend Development

Guide to Integrating Spring Framework, Spring MVC, and MyBatis

This article provides a step‑by‑step tutorial on building a Spring container, configuring Spring MVC with DispatcherServlet, setting up essential beans such as multipartResolver, custom handler mapping, handler adapter, view resolver, component scanning, and finally integrating MyBatis with SqlSessionFactoryBean and SqlSessionTemplate for a complete Java backend solution.

MyBatisSpringXML Configuration
0 likes · 10 min read
Guide to Integrating Spring Framework, Spring MVC, and MyBatis
Java Captain
Java Captain
Mar 20, 2018 · Backend Development

Implementing Pagination in a Java Web Application with Spring MVC and MyBatis

This article demonstrates how to implement page-based data retrieval in a Java web application using Spring MVC, MyBatis, and a custom Page utility class, covering the creation of the pagination class, mapper XML, DAO interfaces, service logic, controller handling, and JSP pagination controls.

MyBatisWeb Developmentbackend
0 likes · 10 min read
Implementing Pagination in a Java Web Application with Spring MVC and MyBatis
Java Backend Technology
Java Backend Technology
Mar 4, 2018 · Backend Development

Why is DefaultSqlSession Not Thread‑Safe and How Does SqlSessionTemplate Ensure Safety?

This article examines the thread‑unsafe nature of MyBatis's DefaultSqlSession, explains how SqlSessionTemplate and SqlSessionManager use proxy and ThreadLocal mechanisms to provide safe database access in Spring‑integrated environments, and presents related interview questions for deeper understanding.

Java PersistenceMyBatisSqlSession
0 likes · 7 min read
Why is DefaultSqlSession Not Thread‑Safe and How Does SqlSessionTemplate Ensure Safety?
Meituan Technology Team
Meituan Technology Team
Jan 18, 2018 · Backend Development

Analysis of MyBatis First‑Level and Second‑Level Cache Mechanisms

The article thoroughly examines MyBatis’s first‑level (session) and second‑level (namespace) caches, detailing their configurations, internal workflows, source‑code implementations, experimental behaviors, common pitfalls such as stale or dirty data, and advises disabling built‑in caching in favor of dedicated solutions for production.

MyBatisORMcache
0 likes · 25 min read
Analysis of MyBatis First‑Level and Second‑Level Cache Mechanisms
Programmer DD
Programmer DD
Jan 14, 2018 · Backend Development

Integrating Spring Security with MyBatis for Database‑Based Login

This guide shows how to combine Spring Security and MyBatis to implement username‑password authentication backed by a MariaDB database, covering repository cloning, database setup, Maven execution, and a deep dive into the underlying authentication filter and provider classes with code examples.

DatabaseMyBatisSpring Boot
0 likes · 9 min read
Integrating Spring Security with MyBatis for Database‑Based Login
ITPUB
ITPUB
Oct 14, 2017 · Databases

Cutting a Slow Oracle Search Query from Cost 13902 to Under 100

This article walks through diagnosing a sluggish Oracle search query with many optional filters, removing unnecessary joins and function calls, applying conditional MyBatis joins, and creating composite indexes to dramatically lower the execution plan cost from 13902 to under 100.

IndexingMyBatisOracle
0 likes · 11 min read
Cutting a Slow Oracle Search Query from Cost 13902 to Under 100
ITPUB
ITPUB
Jul 21, 2017 · Databases

How to Fix MySQL Emoji Errors with utf8mb4: A Complete Guide

This article explains why MySQL throws "Incorrect string value" when storing emojis, how utf8mb4 solves the problem, and provides step‑by‑step instructions—including table conversion, my.cnf changes, connector upgrades, and runtime workarounds—for reliable emoji storage.

Character SetEmojiJDBC
0 likes · 7 min read
How to Fix MySQL Emoji Errors with utf8mb4: A Complete Guide
Java Backend Technology
Java Backend Technology
Dec 29, 2016 · Backend Development

Mastering Database Read/Write Splitting with Spring AOP: A Practical Demo

This article explains the concept of read/write splitting in distributed databases, outlines two implementation methods—static dual data sources and dynamic AOP-based switching—provides a complete Spring‑MyBatis demo with configuration files, code snippets, and guidance on setting up master and slave connections.

Database ReplicationMyBatisSpring AOP
0 likes · 7 min read
Mastering Database Read/Write Splitting with Spring AOP: A Practical Demo
Java Backend Technology
Java Backend Technology
Sep 22, 2016 · Backend Development

How to Build a Flexible Business Log System with Koala and MyBatis

This article introduces the ufind-businesslog framework, explains its improvements over the original Koala project, and provides step‑by‑step guidance on configuring annotations, Groovy log templates, thread pools, and custom exporters to achieve non‑intrusive, asynchronous business logging in Java applications.

GroovyMyBatisSpring AOP
0 likes · 14 min read
How to Build a Flexible Business Log System with Koala and MyBatis