Hoshiumi
星海日和
= 代码落在地上,故事落在星海 =
跨越星轨的客
技术 · 生活 · 番剧 · 音乐
Posts
This article describes how to develop a simple "Hello World" application using Spring Boot 3.3.4, covering project creation, dependency management, controller writing, packaging deployment, automatic configuration mechanisms, configuration file use, multi-environment configuration, development tools and hot deployment, Lombok use, and interceptors and data source integration. It focuses on Spring Boot's unified management of dependent versions through parent projects, simplified dependency introduction using initiators, and automatic configuration based on annotations. It also recommends YAML configuration, Profile multi-environment management, security configuration practices and development optimization solutions.
This article systematically introduces the core concepts, configuration methods, Bean life cycle, automatic assembly, cyclic dependency processing, annotation use, AOP proxy mechanism, and integration with MyB and transactions of Spring IoC and dependency injection. It focuses on the implementation of dependency injection through Setter or constructor, Bean scope and life cycle management, as well as automatic component registration and dependency injection through annotations and configuration classes, and combined with AOP to achieve decoupling and management of crosscutting concerns such as logging, transactions, etc. Finally, it demonstrates the integration practice of Spring and MyBatis, emphasizing that Spring can uniformly manage data sources, SqlSessionFactory and transactions, avoiding manual manipulation of database sessions.
This article comprehensively and systematically combs MyBatis 'complete set of knowledge systems, from basic concepts to advanced actual combat, covering configuration, core components, dynamic SQL, associated queries, caching mechanisms, type processors, plug-in development, performance optimization, and common problem troubleshooting. It also introduces the usage scenarios and core features of MyBatis-Plus as an enhanced tool, and provides practical cases and error troubleshooting guides, which are suitable for beginners to learn and senior developers to refer to.
This article provides a comprehensive introduction to the core concepts and practices of MyBatis reverse engineering, covering the two major tools: MyBatis Generator (MBG) and MyBatis-Plus code generator. MBG can automatically generate entity classes, Mapper interfaces, and XML files based on the database table structure, and supports flexible operation through configuration files or plug-ins;MyBatis-Plus Generator is more powerful and can generate full-stack code such as entities, Mapper, Services, and Controllers with one click, and supports annotations and custom templates such as Lombok and Swagger. The article explains in detail configuration items, operation methods, troubleshooting common problems and best practices, and emphasizes that generated code should be separated from custom code to ensure reusability and stability.
This article introduces the core features and usage scenarios of MyBatis-Plus, emphasizing that it implements advanced functions such as universal CRUD, conditional constructor, paging, logical deletion, and optimistic locking through non-intrusive enhancements based on native MyBatis, significantly improving development efficiency. It focuses on explaining core functions such as entity class annotation configuration, general CRUD operations, Wrapper conditional constructor, automatic population, and logical deletion, and provides an in-depth analysis of the underlying execution principles and common problems to help developers master the practical application of MP and interview points.
This article introduces the core architecture and configuration of MyBatis, including core configuration files, Mapper interface and XML mapping, SQL execution process and result mapping mechanism. It focuses on environment configuration, property file use, SQL parameter placeholder security specifications, usage principles of SqlSessionFactory and SqlSession, and scenario applications of automatic and manual result mapping, and lists troubleshooting methods for common problems.
This article systematically combs Git's commonly used commands, classifies them according to the actual development process, covering core functions such as warehouse initialization, configuration, status view, file operations, branch management, merge and rebase, submit history operations, label management, and error recovery. Emphasis is placed on operational security and collaboration specifications, such as avoiding direct forced push, using carefully rewriting historical commands, and recommending the use of mechanisms such as reflog and stash for misoperation recovery.
This article introduces the basic concepts of Java annotations, meta-annotation mechanism, the definition and use of custom annotations, and the practical application of annotations in permission verification and database mapping. By reflecting and parsing annotations, metadata-driven functions can be realized, but the annotations themselves only provide meta information, and the actual logic needs to be implemented by a framework or program. The article emphasizes that annotations need to be combined with run-time retention policy (RUNTIME) and security verification, and that duplicate implementation of ORM functions should be avoided in actual projects. It is recommended to use mature frameworks.
This article introduces the core concepts and usage methods of Java reflection mechanism, and explains how to dynamically obtain class information, create objects, access fields, and call methods at run time through Class objects. Combined with actual cases, this paper demonstrates the application of reflection in implementing a general DAO, but points out that it has limitations such as the consistency of class names and table names, strict field mapping, and emphasizes that attention should be paid to security, readability and exception handling when using reflection. It is recommended to use it only when necessary and the input needs to be strictly verified.
This article introduces the basic concepts, usage process and best practices of JDBC. JDBC is a standardized interface used in Java to access databases. It connects different databases through drivers and supports connection management, SQL operations, transaction control and metadata acquisition. The article explains in detail how to configure MySQL drivers, establish connections, perform additions, deletions and changes, use PreparedStatement to prevent SQL injection, process query result sets, and transaction management, and emphasizes key considerations in resource shutdown, password security, code encapsulation, and database design.