Source:
public void initialize() { super.initialize(); SQLDirectoryDescriptor descriptor = getDescriptor(); try (Connection sqlConnection = getConnection()) { dialect = Dialect.createDialect(sqlConnection, null); String tableName = (descriptor.tableName == null) ? descriptor.name : descriptor.tableName; table = SQLHelper.addTable(tableName, dialect, useNativeCase()); SchemaManager schemaManager = Framework.getService(SchemaManager.class); schema = schemaManager.getSchema(getSchema()); if (schema == null) { throw new DirectoryException("schema not found: " + getSchema()); } readColumnsAll = new LinkedList<>(); readColumns = new LinkedList<>(); boolean hasPrimary = false; for (Field f : schema.getFields()) { String fieldName = f.getName().getLocalName(); if (!isReference(fieldName)) { boolean isId = fieldName.equals(getIdField()); ColumnType type = ColumnType.fromField(f); if (isId && descriptor.isAutoincrementIdField()) { type = ColumnType.AUTOINC; } Column column = SQLHelper.addColumn(table, fieldName, type, useNativeCase()); if (isId) { if (descriptor.isAutoincrementIdField()) { column.setIdentity(true); } column.setPrimary(true); column.setNullable(false); idColumn = column; hasPrimary = true; } readColumnsAll.add(column); if (!fieldName.equals(descriptor.passwordField)) { readColumns.add(column); } } } readColumnsAllSQL = readColumnsAll.stream().map(Column::getQuotedName).collect(Collectors.joining(", ")); readColumnsSQL = readColumns.stream().map(Column::getQuotedName).collect(Collectors.joining(", ")); if (!hasPrimary) { throw new DirectoryException(String.format("Directory '%s' id field '%s' is not present in schema '%s'", getName(), getIdField(), getSchema())); } SQLHelper helper = new SQLHelper(sqlConnection, table, descriptor.getCreateTablePolicy()); boolean loadData = helper.setupTable(); if (TransactionHelper.isTransactionActiveOrMarkedRollback()) { TransactionHelper.commitOrRollbackTransaction(); TransactionHelper.startTransaction(); } if (loadData) { loadData(); } } catch (SQLException e) { throw new DirectoryException(e); } }

Target:
public void initialize() { super.initialize(); SQLDirectoryDescriptor descriptor = getDescriptor(); try (Connection sqlConnection = getConnection()) { dialect = Dialect.createDialect(sqlConnection, null); String tableName = descriptor.tableName == null ? descriptor.name : descriptor.tableName; table = SQLHelper.addTable(tableName, dialect, useNativeCase()); SchemaManager schemaManager = Framework.getService(SchemaManager.class); schema = schemaManager.getSchema(getSchema()); if (schema == null) { throw new DirectoryException("schema not found: " + getSchema()); } readColumnsAll = new LinkedList<>(); readColumns = new LinkedList<>(); boolean hasPrimary = false; for (Field f : schema.getFields()) { String fieldName = f.getName().getLocalName(); if (!isReference(fieldName)) { boolean isId = fieldName.equals(getIdField()); ColumnType type = ColumnType.fromField(f); if (isId && descriptor.isAutoincrementIdField()) { type = ColumnType.AUTOINC; } Column column = SQLHelper.addColumn(table, fieldName, type, useNativeCase()); if (isId) { if (descriptor.isAutoincrementIdField()) { column.setIdentity(true); } column.setPrimary(true); column.setNullable(false); idColumn = column; hasPrimary = true; } readColumnsAll.add(column); if (!fieldName.equals(descriptor.passwordField)) { readColumns.add(column); } } } readColumnsAllSQL = readColumnsAll.stream().map(Column::getQuotedName).collect(Collectors.joining(", ")); readColumnsSQL = readColumns.stream().map(Column::getQuotedName).collect(Collectors.joining(", ")); if (!hasPrimary) { throw new DirectoryException(String.format("Directory '%s' id field '%s' is not present in schema '%s'", getName(), getIdField(), getSchema())); } SQLHelper helper = new SQLHelper(sqlConnection, table, descriptor.getCreateTablePolicy()); boolean tableExists = !helper.setupTable(); if (TransactionHelper.isTransactionActiveOrMarkedRollback()) { TransactionHelper.commitOrRollbackTransaction(); TransactionHelper.startTransaction(); } loadDataOnInit(tableExists); } catch (SQLException e) { throw new DirectoryException(e); } }