Getting m-to-n database table name from meta model

The MetadataTools class provides the methods:

  • getDatabaseTable(MetaClass metaClass)
  • getDatabaseColumn(MetaProperty metaProperty)

Is it possible to also get the database table of a m-to-n releation from the meta model? I need the name of the database tables for (generic) imports of data with native SQL commands.

You can do it by introspecting annotations on the field like it is done in the MetadataTools.getDatabaseColumn() method.