* @throws GenerationException if a database access or file write error occurs
*/
protected int createDefs(final File subDirObj, final String databaseName, final String exclusionPattern) throws GenerationException {
// Create definition object
final ObjectFactory objectFactory = new ObjectFactory();
final SqlResourceDefinition def = objectFactory.createSqlResourceDefinition();
final Query query = objectFactory.createQuery();
def.setQuery(query);
final MetaData metaData = objectFactory.createMetaData();
final Database database = objectFactory.createDatabase();
database.setDefault(databaseName);
metaData.setDatabase(database);
final Table table = objectFactory.createTable();
table.setRole("Parent");
metaData.getTable().add(table);
def.setMetadata(metaData);
StringBuilder queryString = null;
int defsCreated = 0;
// Now inspect the information schema for columns and tables, build definition and write the files