You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to mybatis-user
I want to achieve Select * from patient where last_name like '%john%'
with mybatis 3.0.
I am using the following code but somehow doesn't seam to work as
expected and gets all the records.
select * from patient where last_name like '%'|| #{lastName} ||'%'.
Anyone aware of the solution?
Regards,
Sk
Larry Meadors
unread,
Mar 6, 2012, 9:11:24 AM3/6/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to mybati...@googlegroups.com
That should work - turn on logging and see what the SQL being executed looks like.
Filipe Sousa
unread,
Mar 6, 2012, 9:29:11 AM3/6/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to mybati...@googlegroups.com
You can always call my_select_method("%" + lastName + "%")
Benoît
unread,
Mar 6, 2012, 9:51:41 AM3/6/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to mybatis-user
Alternatively add the '%' chars to your property just before calling
the mapper.