2013年7月28日星期日

Mybatis parameterType Bean can do a query?

This post last edited by the yijiulove on 2013-07-23 17:27:27 <> I am doing a search function, and now the front of the query into a CriteriaForm in ordinary java bean.
Then OrderMapper.xml
add the following paragraph.

  select * from clshop.cl_order where 1 = 1 
and cust_code = # {custCode}
<> and status = # {status}
<> <> <>

But when the project started to get up, would like to ask, is this approach does not support it?
------ Solution ------------- -------------------------------
is possible, Myibatis is support for custom Bean, but not parameterType; Instead parameterClass
------ For reference only ----------------------------------- ----
ah, multi-use map type parameter, can not be a complex type ...
------ For reference only --------------- ------------------------


That I parameterType = "com.cl.shop.bean.CriteriaForm" changed
parameterClass = "com.cl.shop.bean.CriteriaForm" <>?

I try
------ For reference only ------------------------------- --------


can, send out .. Thank you.

1 条评论:

  1. Thank you, I'm still somewhat confused though have an outline of what you mean

    回复删除