Can MyBatis create a database schema?

Does MyBatis have any way to allow the creation of an SQL schema from a class model, such as Hibernate?

I search this on Google and I found information about MyBatis Generator ( http://mybatis.imtqy.com/generator/ ). This tool is apparently useful for generating a Java model from an SQL schema, which is exactly the opposite.

+7
java hibernate ibatis mybatis
Aug 13 '14 at 9:20
source share
1 answer

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.

+8
Aug 16 '14 at 20:36
source share



All Articles