BindingException: Invalid bound statement (not found):

2,542 views
Skip to first unread message

Detali

unread,
Aug 26, 2015, 7:52:20 PM8/26/15
to mybatis-user
hi
I have situation where I have 2 mapper class extends base mapper (CoreMapper here) when in my DAO impl I am trying to access method based - its throw

org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):when I debug I can see its using one mapper at a time -


also when I change my code to use dao.OracleMapper  or dao.SybaseMapper  that works but doesn't work from base mapper interface


do you know why this occurs and how to solve this ?



in my db-mapping.xml I have use base mapper

<mapper namespace="dao.CoreMapper">
</mapper>


mapper have 2 methods - overloaded - we have logic to its called based on connection type in code
public interface CoreMapper {
public int explodeTask(int taskId, int priority);
public void explodeTask(Map<String, Object> parms);
}

interface OracleMapper extends CoreMapper

@Select("{call STqueue(" +
   "#{task, jdbcType=INTEGER, mode=IN}," +
   "#{execution, jdbcType=INTEGER, mode=OUT})}")
 @Options(statementType = StatementType.CALLABLE)
 public void explodeTask(Map<String , Object> parameter);


interface SybaseMapper extends CoreMapper

@Select("{call STqueue(" +

"#{task, jdbcType=INTEGER, mode=IN}," +

@Options(statementType = StatementType.CALLABLE)

public int explodeTask(@Param("task") int taskId,);



org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):

Guy Rouillier

unread,
Aug 26, 2015, 10:04:45 PM8/26/15
to mybatis-user
That makes sense.  Your base interface contains no Select statement.  Have you tried adding a Select statement to the base interface containing all parameters needed for both databases?  Then, in the derived classes, just ignore the parameters that are not needed by a specific DBMS.
 
--
Guy Rouillier
--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mybatis-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



Avast logo

This email has been checked for viruses by Avast antivirus software.
www.avast.com


Reply all
Reply to author
Forward
0 new messages