Can MyBatis create a database schema?
I'm afraid not. For this you need ORM, and MyBatis is not ORM.
Using an ORM solution (for example, Hibernate) you map tables to entities. An entity is a table representation (object) (relational) and contains all the metadata (getters / setters, annotations, etc.) needed to create the table.
MyBatis does not map objects to tables; it maps methods to SQL statements. It is not possible to determine from the methods or SQL statements what the database structure should be. When you use MyBatis, tables must already exist.
Bogdan Aug 16 '14 at 20:36 2014-08-16 20:36
source share