java - Difference between ${"id"} and #{"id"} for getting the object reference? -


what difference between these 2 selectors: $("id") , #('id') getting object reference in mybatis mapper xml. have seen examples like

<select id="selectusers" resulttype="map">   select id, username, hashedpassword   some_table   id = #{id} </select> 

as this

 <select id="selectuser" parametertype="user" resulttype="user">   select id, username, hashedpassword   some_table   id = ${user.id} </select> 

#{id} - mybatis generate preparedstatement
${id} - mybatis directly inject value in statement string

see string_substitution in mybatis documentation.


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -