文档介绍:MyBatis 3
User Guide
Warning about Copying Code from this Document
No, this is not a legal warning. It is one to help you keep your sanity. Modern word
processors do a great job of making text readable and formatted in an aesthetically
pleasing way. However, they also tend pletely ruin code examples by
inserting special characters, sometimes that look exactly the same as the one you
think you want. “Quotes” and hyphens are a perfect example –the quotes and
hyphen you see to the left will not work as quotes in an IDE or text editor, at least
not the way you intend.
So read this document, enjoy it and hopefully it is helpful to you. When es to
code examples, seek out the examples included with the download (including unit
tests etc.), or examples from the website or mailing list.
Help make this documentation better…
If you find this documentation lacking in any way, or missing documentation for a feature,
then the best thing to do is learn about it and then write the documentation yourself!
We accept public documentation contributions through our wiki at:
http://opensource./confluence/oss/display/IBATIS/Contribute+Documentation
You’re the best author of this documentation, people like you have to read it!
Contents
What is MyBatis? .......................................................................................................................................... 6
Getting Started .............................................................................................................................................. 6
Building SqlSessionFactory from XML ....................................................................................................... 6
Building SqlSessionFactory without XML .................................................................................................. 7
Acquiring a SqlSession from SqlSessionFactory ......................................................