摘要:
MyBatis provides great support with plenty of options for mapping the query results to JavaBeans. But sometimes, we may come across scenarios where we 阅读全文
摘要:
Sometimes, we may need to work with huge volumes of data, such as with tables with millions of records. Loading all these records may not be possible 阅读全文
摘要:
If we have a mapped statement that returns multiple rows and we want the results in a HashMap with some property value as the key and the resulting ob 阅读全文
摘要:
MyBatis's mapped statements have the parameterType attribute to specify the type of input parameter. If we want to pass multiple input parameters to a 阅读全文
摘要:
MyBatis provides built-in support for mapping CLOB/BLOB type columns. Assume we have the following table to store the Students and Tutors photographs 阅读全文
摘要:
MyBatis supports persisting enum type properties out of the box. Assume that the STUDENTS table has a column gender of the type varchar to store eithe 阅读全文
摘要:
Sometimes, static SQL queries may not be sufficient for application requirements. We may have to build queries dynamically, based on some criteria.For 阅读全文
摘要:
In the sample domain model, a tutor can teach one or more courses. This means that there is a one-to-many relationship between the tutor and course. W 阅读全文
摘要:
We can get Student along with the Address details using a nested Select query as follows: <resultMap type="Address" id="AddressResult"> <id property=" 阅读全文
摘要:
We can get Student along with the Address details using a nested ResultMap as follows: <resultMap type="Address" id="AddressResult"> <id property="add 阅读全文
摘要:
ResultMaps are used to map the SQL SELECT statement's results to JavaBeans properties. We can define ResultMaps and reference this resultMap query fro 阅读全文
摘要:
We can use the useGeneratedKeys and keyProperty attributes to let the database generate the auto_increment column value and set that generated value i 阅读全文