Java Persistence with MyBatis 3

K. Siva Prasad Reddy

  • 出版商: Packt Publishing
  • 出版日期: 2013-05-20
  • 售價: $1,240
  • 貴賓價: 9.5$1,178
  • 語言: 英文
  • 頁數: 132
  • 裝訂: Paperback
  • ISBN: 1782166807
  • ISBN-13: 9781782166801
  • 相關分類: Java 程式語言
  • 下單後立即進貨 (約3~4週)

商品描述

Getting started with the MYBatis framework is greatly simplified with this step-by-step guide that’s packed with practical exercises. Now you can quickly and confidently take your Java capabilities into the arena of data persistence.

Overview

  • Detailed instructions on how to use MyBatis with XML and Annotation-based SQL Mappers
  • An in-depth discussion on how to map complex SQL query results such as One-To-Many and Many-To-Many using MyBatis ResultMaps
  • Step-by-step instructions on how to integrate MyBatis with a Spring framework

In Detail

Storing and retrieving data to and from relational databases is a very common requirement, and is a crucial part of many applications. Even though Java provides a JDBC API for database access, it is not very effective and involves writing the boilerplate code again and again. Getting data out of a database, populating into Java objects, and persisting data from Java objects into a database using JDBC involves a lot of repetitive coding and is a very tedious process. MyBatis takes the simplest approach of leveraging the existing knowledge and power of Java and SQL yet provides powerful features to make data persistence implementation easy.

Java Persistence with MyBatis 3 is a practical, hands-on guide that provides you with a number of clear step-by-step exercises, which will help you to understand how MyBatis works and how to use it for your real application needs. With MyBatis, you will learn how to use the MyBatis framework effectively through simple instructions.

Java Persistence with MyBatis 3 will highlight the cumbersome process of data persistence using plain JDBC and will also show you how easy it is to implement the same using MyBatis. You will also take a deeper look into the implementation of MyBatis with XML and Annotation-based Mappers, and finally learn how to integrate MyBatis with a Spring framework.

You will learn how to map Complex SQL query results to Java beans using XML and Annotation-based Mappers, including One-To-Many and Many-To-Many relationships. You will also learn how to use TypeAliases and Custom Type Handlers, and build dynamic queries using XML and SqlProvider annotations. It progresses to detailed instructions on integrating MyBatis with Spring and leveraging Spring’s Annotation-based transaction handling mechanism, which further simplifies the usage of MyBatis.With Java Persistence with MyBatis 3, you will learn how to use the MyBatis framework effectively through simple instructions.

What you will learn from this book

  • Simplify database persistence layer implementation
  • Install and configure MyBatis using XML and Java API
  • Map One-To-Many and Many-To-Many results using XML and Annotated Mappers
  • Use TypeAliases and Custom Type Handlers
  • Handle pagination and custom SQL ResultSet processing
  • Build Dynamic Queries using XML and SqlProvider annotations
  • Use Spring’s Annotation-based Transaction Handling with MyBatis

Approach

This book will have a practical approach, thus making it easy for the readers to understand and learn with step-by-step instructions.

Who this book is written for

This book is for Java developers who would like to learn all about the MyBatis framework and are looking for a practical guide to get started. The prerequisites required for this book are basic Java and SQL skills. No prior knowledge of MyBatis is expected.

商品描述(中文翻譯)

使用這本逐步指南,開始使用MYBatis框架將變得非常簡單,並且充滿實用的練習。現在,您可以快速且自信地將Java能力應用於數據持久化領域。

概述:
- 詳細說明如何使用基於XML和注解的SQL映射器使用MyBatis
- 深入討論如何使用MyBatis ResultMaps映射複雜的SQL查詢結果,例如一對多和多對多關係
- 逐步指導如何將MyBatis與Spring框架集成

詳細內容:
將數據存儲到關聯數據庫並從中檢索數據是一個非常常見的需求,也是許多應用程序的關鍵部分。儘管Java提供了用於數據庫訪問的JDBC API,但它並不是非常有效,並且需要一遍又一遍地編寫樣板代碼。使用JDBC從數據庫中獲取數據,將其填充到Java對象中,並將數據從Java對象持久化到數據庫中涉及大量重複編碼,是一個非常繁瑣的過程。MyBatis採用了最簡單的方法,利用Java和SQL的現有知識和能力,並提供了強大的功能,使數據持久化實現變得簡單。

《Java Persistence with MyBatis 3》是一本實用的實踐指南,提供了一系列清晰的逐步練習,幫助您了解MyBatis的工作原理以及如何應用於實際應用需求。通過MyBatis,您將學習如何通過簡單的指導有效地使用MyBatis框架。

《Java Persistence with MyBatis 3》將突出顯示使用普通JDBC進行數據持久化的繁瑣過程,並向您展示使用MyBatis實現相同功能的簡單性。您還將深入研究使用XML和基於注解的映射器實現MyBatis,最後學習如何將MyBatis與Spring框架集成。

您將學習如何使用XML和基於注解的映射器將複雜的SQL查詢結果映射到Java bean,包括一對多和多對多關係。您還將學習如何使用TypeAliases和自定義類型處理器,以及使用XML和SqlProvider注解構建動態查詢。它進一步詳細介紹了如何將MyBatis與Spring集成,並利用Spring的基於注解的事務處理機制,進一步簡化MyBatis的使用。通過《Java Persistence with MyBatis 3》,您將學習如何通過簡單的指導有效地使用MyBatis框架。

本書的特點:
- 簡化數據庫持久化層實現
- 使用XML和Java API安裝和配置MyBatis
- 使用XML和注解映射器映射一對多和多對多結果
- 使用TypeAliases和自定義類型處理器
- 處理分頁和自定義SQL ResultSet處理
- 使用XML和SqlProvider注解構建動態查詢
- 使用Spring的基於注解的事務處理與MyBatis集成

這本書的寫作對象:
本書適合希望全面了解MyBatis框架並尋找實用指南入門的Java開發人員。閱讀本書所需的先備知識是基本的Java和SQL技能,不需要事先了解MyBatis。