<s>
MyBatis	B-Library
is	O
a	O
Java	B-Language
persistence	B-Library
framework	I-Library
that	O
couples	O
objects	O
with	O
stored	B-General_Concept
procedures	I-General_Concept
or	O
SQL	B-Language
statements	O
using	O
an	O
XML	B-Protocol
descriptor	O
or	O
annotations	O
.	O
</s>
<s>
MyBatis	B-Library
is	O
free	B-Application
software	I-Application
that	O
is	O
distributed	O
under	O
the	O
Apache	B-Application
License	I-Application
2.0	O
.	O
</s>
<s>
MyBatis	B-Library
is	O
a	O
fork	O
of	O
iBATIS	B-Library
3.0	O
and	O
is	O
maintained	O
by	O
a	O
team	O
that	O
includes	O
the	O
original	O
creators	O
of	O
iBATIS	B-Library
.	O
</s>
<s>
Unlike	O
ORM	B-General_Concept
frameworks	O
,	O
MyBatis	B-Library
does	O
not	O
map	O
Java	B-Language
objects	O
to	O
database	O
tables	O
but	O
Java	B-Language
methods	O
to	O
SQL	B-Language
statements	O
.	O
</s>
<s>
MyBatis	B-Library
lets	O
you	O
use	O
all	O
your	O
database	O
functionality	O
like	O
stored	B-General_Concept
procedures	I-General_Concept
,	O
views	B-Language
,	O
queries	O
of	O
any	O
complexity	O
and	O
vendor	O
proprietary	O
features	O
.	O
</s>
<s>
It	O
is	O
often	O
a	O
good	O
choice	O
for	O
legacy	O
or	O
de-normalized	O
databases	O
or	O
to	O
obtain	O
full	O
control	O
of	O
SQL	B-Language
execution	O
.	O
</s>
<s>
It	O
simplifies	O
coding	O
compared	O
to	O
JDBC	B-Language
.	O
</s>
<s>
SQL	B-Language
statements	O
are	O
executed	O
with	O
a	O
single	O
line	O
.	O
</s>
<s>
MyBatis	B-Library
provides	O
a	O
mapping	O
engine	O
that	O
maps	O
SQL	B-Language
results	O
to	O
object	O
trees	O
in	O
a	O
declarative	O
way	O
.	O
</s>
<s>
SQL	B-Language
statements	O
can	O
be	O
built	O
dynamically	O
by	O
using	O
a	O
built-in	O
language	O
with	O
XML-like	O
syntax	O
or	O
with	O
Apache	B-Language
Velocity	I-Language
using	O
the	O
Velocity	O
integration	O
plugin	O
.	O
</s>
<s>
MyBatis	B-Library
integrates	O
with	O
Spring	B-Application
Framework	I-Application
and	O
Google	B-Application
Guice	I-Application
.	O
</s>
<s>
MyBatis	B-Library
supports	O
declarative	O
data	O
caching	O
.	O
</s>
<s>
MyBatis	B-Library
provides	O
a	O
default	O
cache	O
implementation	O
based	O
on	O
a	O
Java	B-Language
HashMap	O
and	O
default	O
connectors	O
for	O
integrating	O
with	O
:	O
OSCache	O
,	O
Ehcache	B-Language
,	O
Hazelcast	B-Application
and	O
Memcached	B-Application
.	O
</s>
<s>
It	O
provides	O
an	O
API	B-General_Concept
to	O
plug	O
other	O
cache	O
implementations	O
.	O
</s>
<s>
SQL	B-Language
statements	O
are	O
stored	O
in	O
XML	B-Protocol
files	O
or	O
annotations	O
.	O
</s>
<s>
Below	O
depicts	O
a	O
MyBatis	B-Library
mapper	O
,	O
that	O
consists	O
of	O
a	O
Java	B-Language
interface	O
with	O
some	O
MyBatis	B-Library
annotations	O
:	O
</s>
<s>
SQL	B-Language
statements	O
and	O
mappings	O
can	O
also	O
be	O
externalized	O
to	O
an	O
XML	B-Protocol
file	O
as	O
follows	O
.	O
</s>
<s>
Statements	O
can	O
also	O
be	O
executed	O
using	O
the	O
MyBatis	B-Library
API	B-General_Concept
.	O
</s>
<s>
For	O
details	O
,	O
please	O
refer	O
to	O
the	O
User	O
Guide	O
available	O
at	O
MyBatis	B-Library
site	O
.	O
</s>
<s>
MyBatis	B-Library
integrates	O
with	O
Spring	B-Application
Framework	I-Application
.	O
</s>
<s>
This	O
module	O
allows	O
MyBatis	B-Library
to	O
participate	O
in	O
Spring	O
transactions	O
.	O
</s>
<s>
It	O
will	O
also	O
build	O
MyBatis	B-Library
mappers	O
and	O
sessions	O
and	O
inject	O
them	O
into	O
other	O
beans	O
.	O
</s>
<s>
The	O
following	O
sample	O
shows	O
a	O
basic	O
XML	B-Protocol
configuration	O
that	O
sets	O
up	O
a	O
mapper	O
and	O
injects	O
it	O
into	O
a	O
"	O
BlogService	O
"	O
bean	O
.	O
</s>
<s>
Calling	O
MyBatis	B-Library
is	O
now	O
just	O
calling	O
a	O
bean	O
:	O
</s>
<s>
The	O
Velocity	O
language	O
driver	O
lets	O
you	O
use	O
Apache	B-Language
Velocity	I-Language
to	O
generate	O
your	O
dynamic	O
SQL	B-Language
queries	O
on	O
the	O
fly	O
.	O
</s>
<s>
MyBatis	B-Library
provides	O
a	O
code	O
generator	O
.	O
</s>
<s>
MyBatis	B-Library
Generator	O
will	O
introspect	O
a	O
database	O
table	O
(	O
or	O
many	O
tables	O
)	O
and	O
generate	O
MyBatis	B-Library
artifacts	O
needed	O
to	O
perform	O
CRUD	B-General_Concept
operations	O
(	O
Create	O
,	O
Retrieve	O
,	O
Update	O
,	O
Delete	O
)	O
.	O
</s>
<s>
An	O
Eclipse	B-Application
plugin	O
is	O
available	O
.	O
</s>
<s>
It	O
will	O
preserve	O
any	O
custom	O
code	O
in	O
case	O
of	O
regeneration	O
but	O
only	O
if	O
you	O
use	O
the	O
Eclipse	B-Application
plugin	O
.	O
</s>
<s>
MyBatis	B-Library
Migrations	O
is	O
a	O
Java	B-Language
command	B-Device
line	I-Device
tool	I-Device
that	O
keeps	O
track	O
of	O
database	O
schema	O
changes	O
managing	O
DDL	B-Language
files	O
(	O
known	O
as	O
migrations	O
)	O
.	O
</s>
<s>
MyBatis	B-Library
project	O
is	O
a	O
subsidiary	O
of	O
iBATIS	B-Library
3.0	O
and	O
maintained	O
by	O
a	O
team	O
which	O
includes	O
the	O
original	O
creators	O
of	O
iBATIS	B-Library
.	O
</s>
<s>
The	O
project	O
was	O
created	O
on	O
May	O
19	O
,	O
2010	O
when	O
Apache	B-Library
iBATIS	I-Library
3.0	O
was	O
published	O
and	O
the	O
team	O
announced	O
that	O
the	O
development	O
will	O
continue	O
under	O
a	O
new	O
name	O
and	O
a	O
new	O
home	O
at	O
Google	O
Code	O
.	O
</s>
