Cover image for Implementing MyBatis.
Implementing MyBatis.
Title:
Implementing MyBatis.
Author:
Reddy, K. Siva Prasad.
ISBN:
9781782166818
Personal Author:
Edition:
1st ed.
Physical Description:
1 online resource (142 pages)
Contents:
Java Persistence with MyBatis 3 -- Table of Contents -- Java Persistence with MyBatis 3 -- Credits -- About the Author -- About the Reviewers -- www.PacktPub.com -- Support files, eBooks, discount offers and more -- Why Subscribe? -- Free Access for Packt account holders -- Preface -- What this book covers -- What you need for this book -- Who this book is for -- Conventions -- Reader feedback -- Customer support -- Downloading the example code -- Errata -- Piracy -- Questions -- 1. Getting Started with MyBatis -- What is MyBatis? -- Why MyBatis? -- Eliminates a lot of JDBC boilerplate code -- Low learning curve -- Works well with legacy databases -- Embraces SQL -- Supports integration with Spring and Guice frameworks -- Supports integration with third-party cache libraries -- Better performance -- Installing and configuring MyBatis -- Creating a STUDENTS table and inserting sample data -- Creating a Java project and adding mybatis-3.2.2.jar to the classpath -- Creating the mybatis-config.xml and StudentMapper.xml configuration files -- Creating the MyBatisSqlSessionFactory singleton class -- Creating the StudentMapper interface and the StudentService classes -- Creating a JUnit test for testing StudentService -- How it works -- Sample domain model -- Summary -- 2. Bootstrapping MyBatis -- Configuring MyBatis using XML -- Environment -- DataSource -- TransactionManager -- Properties -- typeAliases -- typeHandlers -- Settings -- Mappers -- Configuring MyBatis using Java API -- Environment -- DataSource -- TransactionFactory -- typeAliases -- typeHandlers -- Settings -- Mappers -- Customizing MyBatis logging -- Summary -- 3. SQL Mappers Using XML -- Mapper XMLs and Mapper interfaces -- Mapped statements -- The INSERT statement -- Autogenerated keys -- The UPDATE statement -- The DELETE statement -- The SELECT statement -- ResultMaps.

Simple ResultMaps -- Extending ResultMaps -- One-to-one mapping -- One-to-one mapping using nested ResultMap -- One-to-one mapping using nested Select -- One-to-many mapping -- One-to-many mapping with nested ResultMap -- One-to-many mapping with nested select -- Dynamic SQL -- The If condition -- The choose, when, and otherwise conditions -- The where condition -- The trim condition -- The foreach loop -- The set condition -- MyBatis recipes -- Handling enumeration types -- Handling the CLOB/BLOB types -- Passing multiple input parameters -- Multiple results as a map -- Paginated ResultSets using RowBounds -- Custom ResultSet processing using ResultSetHandler -- Cache -- Summary -- 4. SQL Mappers Using Annotations -- Mapper interfaces using annotations -- Mapped statements -- @Insert -- Autogenerated keys -- @Update -- @Delete -- @Select -- Result maps -- One-to-one mapping -- One-to-many mapping -- Dynamic SQL -- @InsertProvider -- @UpdateProvider -- @DeleteProvider -- Summary -- 5. Integration with Spring -- Configuring MyBatis in a Spring application -- Installation -- Configuring MyBatis beans -- Working with SqlSession -- Working with mappers -- -- @MapperScan -- Transaction management using Spring -- Summary -- Index.
Abstract:
This book will have a practical approach, thus making it easy for the readers to understand and learn with step-by-step instructions.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.
Local Note:
Electronic reproduction. Ann Arbor, Michigan : ProQuest Ebook Central, 2017. Available via World Wide Web. Access may be limited to ProQuest Ebook Central affiliated libraries.
Electronic Access:
Click to View
Holds: Copies: