Introspect multiple tables at once

36 views
Skip to first unread message

Ryan Conklin

unread,
Nov 13, 2012, 1:57:14 PM11/13/12
to mybati...@googlegroups.com
Besides duplicating like the example below, is there a faster way to introspect multiple tables at once?           




                <table schema="" tableName="organization" domainObjectName="">
                        <property name="useActualColumnNames" value="true" />
                        <property name="ignoreQualifiersAtRuntime" value="true" />
                        <generatedKey column="name" sqlStatement="MySql" identity="true" type="post" />
                        <!--columnOverride column="DATE_FIELD" property="startDate" />
                        <ignoreColumn column="FRED" />
                        <columnOverride column="LONG_VARCHAR_FIELD" jdbcType="VARCHAR" / -->
</table>
<table schema="" tableName="addresses" domainObjectName="">
                        <property name="useActualColumnNames" value="true" />
                        <property name="ignoreQualifiersAtRuntime" value="true" />
                        <generatedKey column="street" sqlStatement="MySql" identity="true" type="post" />
                        <!--columnOverride column="DATE_FIELD" property="startDate" />
                        <ignoreColumn column="FRED" />
                        <columnOverride column="LONG_VARCHAR_FIELD" jdbcType="VARCHAR" / -->

Ryan Conklin

unread,
Nov 14, 2012, 5:17:46 PM11/14/12
to mybati...@googlegroups.com
So FYI for anyone that is planning on doing a 1000+ tables, I encountered a heap dump "out of memory" error while running Mybatis Generator. I had to increase my total allowed memory for the project to Xmx512.

Jeff Butler

unread,
Nov 14, 2012, 5:42:45 PM11/14/12
to mybati...@googlegroups.com
Cool :)

As for your previous question, you can use SQL wildcards in the tableName, so <table tableName="%"/> would generate for every table in the DB.  This won't work well for the tables with identity columns because the identity column can't be easily specified for multiple tables - but it will work for all the others.

Jeff Butler

Javier Domingo

unread,
Nov 14, 2012, 5:52:15 PM11/14/12
to mybati...@googlegroups.com

The solution is to use generic names for columns id instead of table_id etc

Reply all
Reply to author
Forward
0 new messages