Java Reference
In-Depth Information
address2 = #address2:varchar#,
city = #city:varchar#,
state = #state:varchar#,
postalCode = #postalCode:varchar#,
country = #country:varchar#
where accountId = #accountId#
</update>
<delete id="delete">
delete from Account
where accountId = #accountId#
</delete>
B
SQL fragment
for the field list
<sql id="allFields">
accountId as "accountId",
username,
password,
firstName as "firstName",
lastName as "lastName",
address1,
address2,
city,
state,
postalCode as "postalCode",
country
</sql>
C
SQL fragment
for the WHERE
<sql id="whereByExample">
<dynamic prepend=" where ">
<isNotEmpty property="city">
city like #city#
</isNotEmpty>
<isNotNull property="accountId" prepend=" and ">
accountId = #accountId#
</isNotNull>
</dynamic>
</sql>
D
Composite
SQL fragment
<sql id="getByExample">
select
<include refid="allFields" />
from Account
<include refid="whereByExample" />
</sql>
<select id="getAccountListByExample"
resultClass="Account">
<include refid="getByExample" />
</select>
E
Mapped statement
for a bean
Search WWH ::




Custom Search