mybatis / generator

A code generator for MyBatis.
http://www.mybatis.org/generator/
5.28k stars 2.52k forks source link

about <table> schema attribute #1253

Closed ndsun closed 6 days ago

ndsun commented 1 week ago

I hava a question.When I use MBG to generator mapper.xml from a table, I should add schema attribute to avoid to scan other schemas. But I hope there is not schema prefix to the table name in the result xml file, how can I do? Fox example,my schema is RMS and table name is STUDENT, then in the result mapper file, the sql is like this : insert into RMS.STUDENT...,but I hope the sql is insert into STUDENT, without schema prefix.Hope your answer, thank you!

jeffgbutler commented 1 week ago

There's a property for this. See the documentation here: https://mybatis.org/generator/configreference/table.html

<table ... >
  <property name="ignoreQualifiersAtRuntime" value="true" />
</table>
ndsun commented 6 days ago

There's a property for this. See the documentation here: https://mybatis.org/generator/configreference/table.html

<table ... >
  <property name="ignoreQualifiersAtRuntime" value="true" />
</table>

Got it, thank you very much!