On 12/05/2005 15:39, "Sergey Livanov" <[EMAIL PROTECTED]> wrote:
> > Could you, please, help me find an error, > very simple statement, but not work.. > > <statement id="getPayorders" resultMap="payorder_result"> > > select d.payorder > from fin.payorders d > where d.partner = #partner# Take off the <dynamic>? Below a working example that I have: SELECT * FROM myTable WHERE condition_clause AND some_other_condition_clause <isNotNull prepend="AND" property="description"> description LIKE #description# </isNotNull> > <dynamic> > <isGreaterThan prepend=" and " property="owner" compareValue="0"> > d.owner = #owner# > </isGreaterThan> > </dynamic> > > </statement> > > without dynamic all works, > Log4J text. > > 2005-05-12 16:26:52,718 INFO main TestIbatis TestIbatis - Executing: > 2005-05-12 16:26:53,703 DEBUG main com.ibatis.common.jdbc.SimpleDataSource > com.ibatis.common.jdbc.SimpleDataSource - Created connection 8002486. > 2005-05-12 16:26:53,703 DEBUG main java.sql.Connection > com.ibatis.common.jdbc.logging.ConnectionLogProxy - {conn-100000} Connection > 2005-05-12 16:26:53,765 DEBUG main java.sql.PreparedStatement > com.ibatis.common.jdbc.logging.PreparedStatementLogProxy - {pstm-100001} > PreparedStatement: > select d.payorder from sell.payorders d where d.partner = ? > <dynamic><isGreaterThan prepend=" and " property="owner" > compareValue="0"> d.owner = ? </isGreaterThan></dynamic> > 2005-05-12 16:26:53,765 DEBUG main java.sql.PreparedStatement > com.ibatis.common.jdbc.logging.PreparedStatementLogProxy - {pstm-100001} > Parameters: [1, 15842] > 2005-05-12 16:26:53,765 DEBUG main java.sql.PreparedStatement > com.ibatis.common.jdbc.logging.PreparedStatementLogProxy - {pstm-100001} > Types: [java.lang.Long, java.lang.Long] > 2005-05-12 16:26:53,781 DEBUG main com.ibatis.common.jdbc.SimpleDataSource > com.ibatis.common.jdbc.SimpleDataSource - Returned connection 8002486 to pool. >