Guy Rouillier
unread,Feb 20, 2013, 11:12:15 PM2/20/13Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
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
On 2/20/2013 4:45 PM, Jack Peterson wrote:
> select * from company where id = #{id}
> you can keep where it says id, thats the name of your column
> the $ is for properties, the # is for mybatis i believe to get the
> actual value of id
$ is for string substition, while # is for JDBC parameters. You can use
string substitution here, but there is no good reason to do so. While
sometimes string substitution is necessary (to make the table name
changeable at run-time, for instance), but it has risks of SQL
injection. So only use it when you have no viable alternatives.
--
Guy Rouillier