简体   繁体   中英

mybatis delete mapper get param from object

How can I define my mapper for delete action for some object. For example, something like this:

@Delete("delete from customer c where c.id = #{customerID:INTEGER} ")

public void delete(Customer customer);

Is something like that possible?

When I try something like that I get exception while running test:

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

Please make sure there is a get/set method for customerID in your Customer class.

Otherwise, please post your Customer class for us to help you.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM