iBatis DataMapper 2.0

Introduction

Concept

Easy map Java Beans to PreparedStatement params and Results

Param Object

JavaBean

Map

Primitive (Integer,String

Installation

SQL Map XML Configuration File

SQL Map File

Mapped Statements

Parameter maps and Inline Parameters

Result Maps

properties

id

Subtopic

class

or

type alias

fully qualified name of class

extends

Name of another result map

used as base result Map

super properties always inserted before sub

group by

list of resutl map properties

used to identify unique rows

result

property

name of java bean property

column

name of column in result set

columnIndex

optional/ minimal performance improvement

jdbcType

for things like date where ??

javaType

explicitly specify java property type

Used for Map and xml mapping types

nullValue

value for nullabe object types

select

describe rel between obj and complex property

Must be name of mapped statement

column must support primitve property type

resultMap

descibe nested result map that can be resued

can specify 1:1 and 1:N relationships

1:N requires a group by property

This sounds interesting how is this done ?

typeHandler

used to specify custom types

override ibatis type handler

implements com.ibatis.sqlmap.engine.type.TypeHandler

or com.ibatis.sqlmap.client.extensions.TypeHandlerCallback interface

used to map result ma p property to java bean method

Implicit Result Maps

for simple maps make column names match up to getter setters

Use resultClass attribute in select

Caching Mapped Statement Results

Dyanamic Mapped Statemetns

Simple Dynamic SQL Elements

Programming with Data Mapper API

Logging SQLMap Activity

One page Java Beans Cource

Resources

SimpleDataSource