Coding With Fun
Home Docker Django Node.js Articles FAQ

There are several ways the MyBatis interface is bound

May 16, 2021 MyBatis

Interface binding is available in two ways

1, the use of annotations, in the interface method above the @[email protected] and other annotations, which are written on the corresponding SQL statement for SQL statement binding.

2, by mapping the file xml way to bind, specify the xml mapping file of the namespace corresponding to the interface of the full path name

When do I bind with annotations? When to bind with xml?

When SQL statements are relatively simple, the use of annotation binding on it, when SQL statements are more complex, the use of xml binding, generally with xml binding more