iBATIS.NET - DataMapper Application Framework

DataMapper Developer Guide

Ted Husted

Gilles Bayon

Clinton Begin

Roberto Rabe

Version 1.6.1

Legal Notice

March 2007

1. Introduction
1.1. Overview
1.2. What's covered here
1.3. Release change log
1.4. License Information
1.5. Support
1.6. Disclaimer
2. The Big Picture
2.1. Introduction
2.2. What does it do?
2.3. How does it work?
2.4. Is iBATIS the best choice for my project?
3. Working with Data Maps
3.1. Introduction
3.2. What's in a Data Map definition file, anyway?
3.3. Mapped Statements
3.3.1. Statement Types
3.3.2. Stored Procedures
3.3.3. The SQL Reusing SQL Fragments Escaping XML symbols Auto-Generated Keys <generate> tag <generate> tag attributes
3.3.4. Statement-type Element Attributes id parameterMap parameterClass resultMap resultClass listClass cacheModel extends
3.4. Parameter Maps and Inline Parameters
3.4.1. <parameterMap> attributes id class extends
3.4.2. <parameter> Elements property column direction dbType type nullValue size precision scale typeHandler
3.4.3. Inline Parameter Maps
3.4.4. Standard Type Parameters
3.4.5. Map or IDictionary Type Parameters
3.5. Result Maps
3.5.1. Extending resultMaps
3.5.2. <resultMap> attributes id class extends groupBy
3.5.3. <constructor> element argumentName column columnIndex dbType type resultMapping nullValue select typeHandler
3.5.4. <result> Elements property column columnIndex dbType type resultMapping nullValue select lazyLoad typeHandler
3.5.5. Custom Type Handlers
3.5.6. Inheritance Mapping
3.5.7. Implicit Result Maps
3.5.8. Primitive Results (i.e. String, Integer, Boolean)
3.5.9. Maps with ResultMaps
3.5.10. Complex Properties
3.5.11. Avoiding N+1 Selects (1:1)
3.5.12. Complex Collection Properties
3.5.13. Avoiding N+1 Select Lists (1:M and M:N)
3.5.14. Composite Keys or Multiple Complex Parameters Properties
3.6. Supported Types for Parameter Maps and Result Maps
3.7. Supported database types for Parameter Maps and Result Maps
3.8. Cache Models
3.8.1. Read-Only vs. Read/Write
3.8.2. Serializable Read/Write Caches
3.8.3. Cache Implementation
3.8.4. "MEMORY"
3.8.5. "LRU"
3.8.6. "FIFO"
3.9. Dynamic SQL
3.9.1. Binary Conditional Elements Binary Conditional Attributes:
3.9.2. Unary Conditional Elements Unary Conditional Attributes:
3.9.3. Parameter Present Elements Parameter Present Attributes:
3.9.4. Iterate Element Iterate Attributes:
3.9.5. Simple Dynamic SQL Elements
4. .NET Developer Guide
4.1. Introduction
4.2. Installing the DataMapper for .NET
4.2.1. Setup the Distribution
4.2.2. Add Assembly References
4.2.3. Add XML File Items
4.2.4. Visual Studio.NET Integration
4.3. Configuring the DataMapper for .NET
4.3.1. DataMapper clients
4.3.2. DataMapper Configuration File (SqlMap.config)
4.3.3. DataMapper Configuration Elements The <properties> Element <properties> attributes <property> element and attributes The <providers> Element <providers> attributes The <settings> Element The <typeAlias> Element <typeAlias> attributes type Attribute Predefined type aliases The <typeHandler> Element <typeHandler> attributes The <database> Element The <provider> Element The <datasource> element The <sqlMap> Element
4.4. Programming with iBATIS DataMapper: The .NET API
4.4.1. Building a SqlMapper Instance Multiple Databases DomSqlMapBuilder Configuration Options DomSqlMapBuilder : Advanced settings
4.4.2. Exploring the DataMapper API through the SqlMapper Insert, Update, Delete QueryForObject QueryForList QueryWithRowDelegate QueryForMapWithRowDelegate QueryForPaginatedList QueryForDictionary, QueryForMap
4.4.3. Session
4.4.4. Connection
4.4.5. Automatic Session
4.4.6. Transaction
4.4.7. Distributed Transactions
4.4.8. Coding Examples [TODO: Expand in to a Cookbook of practical examples]
4.5. Logging SqlMap Activity
4.5.1. Sample Logging Configurations
A. iBATIS.NET's SqlMapConfig.xsd
B. iBATIS.NET's SqlMap.xsd