diff --git a/hibernate-core/src/main/java/org/hibernate/tool/schema/extract/internal/InformationExtractorJdbcDatabaseMetaDataImpl.java b/hibernate-core/src/main/java/org/hibernate/tool/schema/extract/internal/InformationExtractorJdbcDatabaseMetaDataImpl.java index be436e5ca3..a5eb2b8001 100644 --- a/hibernate-core/src/main/java/org/hibernate/tool/schema/extract/internal/InformationExtractorJdbcDatabaseMetaDataImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/tool/schema/extract/internal/InformationExtractorJdbcDatabaseMetaDataImpl.java @@ -687,7 +687,7 @@ public class InformationExtractorJdbcDatabaseMetaDataImpl implements Information @Override public Iterable getIndexes(TableInformation tableInformation) { - final Map builders = new HashMap<>(); + final Map builders = new HashMap(); final QualifiedTableName tableName = tableInformation.getName(); final Identifier catalog = tableName.getCatalogName(); final Identifier schema = tableName.getSchemaName(); @@ -766,7 +766,7 @@ public class InformationExtractorJdbcDatabaseMetaDataImpl implements Information @Override public Iterable getForeignKeys(TableInformation tableInformation) { - final Map fkBuilders = new HashMap<>(); + final Map fkBuilders = new HashMap(); final QualifiedTableName tableName = tableInformation.getName(); final Identifier catalog = tableName.getCatalogName(); final Identifier schema = tableName.getSchemaName(); diff --git a/hibernate-core/src/main/java/org/hibernate/tool/schema/extract/internal/TableInformationImpl.java b/hibernate-core/src/main/java/org/hibernate/tool/schema/extract/internal/TableInformationImpl.java index 5afe26fa0e..066417f4c7 100644 --- a/hibernate-core/src/main/java/org/hibernate/tool/schema/extract/internal/TableInformationImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/tool/schema/extract/internal/TableInformationImpl.java @@ -37,7 +37,7 @@ public class TableInformationImpl implements TableInformation { private PrimaryKeyInformation primaryKey; private Map foreignKeys; private Map indexes; - private Map columns = new HashMap<>( ); + private Map columns = new HashMap( ); private boolean wasPrimaryKeyLoaded = false; // to avoid multiple db reads since primary key can be null. @@ -93,7 +93,7 @@ public class TableInformationImpl implements TableInformation { protected Map foreignKeys() { if ( foreignKeys == null ) { - final Map fkMap = new HashMap<>(); + final Map fkMap = new HashMap(); final Iterable fks = extractor.getForeignKeys( this ); for ( ForeignKeyInformation fk : fks ) { fkMap.put( fk.getForeignKeyIdentifier(), fk ); @@ -118,7 +118,7 @@ public class TableInformationImpl implements TableInformation { protected Map indexes() { if ( indexes == null ) { - final Map indexMap = new HashMap<>(); + final Map indexMap = new HashMap(); final Iterable indexes = extractor.getIndexes( this ); for ( IndexInformation index : indexes ) { indexMap.put( index.getIndexIdentifier(), index ); diff --git a/hibernate-core/src/main/java/org/hibernate/tool/schema/extract/spi/NameSpaceTablesInformation.java b/hibernate-core/src/main/java/org/hibernate/tool/schema/extract/spi/NameSpaceTablesInformation.java index 1481fd514a..76bf2eed85 100644 --- a/hibernate-core/src/main/java/org/hibernate/tool/schema/extract/spi/NameSpaceTablesInformation.java +++ b/hibernate-core/src/main/java/org/hibernate/tool/schema/extract/spi/NameSpaceTablesInformation.java @@ -17,7 +17,7 @@ import org.hibernate.mapping.Table; */ public class NameSpaceTablesInformation { private final IdentifierHelper identifierHelper; - private Map tables = new HashMap<>(); + private Map tables = new HashMap(); public NameSpaceTablesInformation(IdentifierHelper identifierHelper) { this.identifierHelper = identifierHelper; diff --git a/hibernate-core/src/main/java/org/hibernate/tool/schema/internal/AbstractSchemaMigrator.java b/hibernate-core/src/main/java/org/hibernate/tool/schema/internal/AbstractSchemaMigrator.java index c05760a9c6..772f19fb99 100644 --- a/hibernate-core/src/main/java/org/hibernate/tool/schema/internal/AbstractSchemaMigrator.java +++ b/hibernate-core/src/main/java/org/hibernate/tool/schema/internal/AbstractSchemaMigrator.java @@ -197,8 +197,8 @@ public abstract class AbstractSchemaMigrator implements SchemaMigrator { tryToCreateCatalogs = true; } } - final Map tablesInformation = new HashMap<>(); - Set exportedCatalogs = new HashSet<>(); + final Map tablesInformation = new HashMap(); + Set exportedCatalogs = new HashSet(); for ( Namespace namespace : database.getNamespaces() ) { final NameSpaceTablesInformation nameSpaceTablesInformation = performTablesMigration( metadata, diff --git a/hibernate-core/src/test/java/org/hibernate/test/schemaupdate/ColumnNamesTest.java b/hibernate-core/src/test/java/org/hibernate/test/schemaupdate/ColumnNamesTest.java index 12fe47e72f..12ce9d2ef8 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/schemaupdate/ColumnNamesTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/schemaupdate/ColumnNamesTest.java @@ -42,9 +42,10 @@ import static org.junit.Assert.assertThat; @RunWith(Parameterized.class) public class ColumnNamesTest { @Parameterized.Parameters - public static Collection parameters() { + public static Collection parameters() { return Arrays.asList( - new String[] {JdbcMetadaAccessStrategy.GROUPED.toString(), JdbcMetadaAccessStrategy.INDIVIDUALLY.toString()} + new String[] { JdbcMetadaAccessStrategy.GROUPED.toString() }, + new String[] { JdbcMetadaAccessStrategy.INDIVIDUALLY.toString()} ); } diff --git a/hibernate-core/src/test/java/org/hibernate/test/schemaupdate/SchemaUpdateTest.java b/hibernate-core/src/test/java/org/hibernate/test/schemaupdate/SchemaUpdateTest.java index 6903062ffb..185c889a15 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/schemaupdate/SchemaUpdateTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/schemaupdate/SchemaUpdateTest.java @@ -58,9 +58,10 @@ import static org.junit.Assert.assertThat; @RunWith(Parameterized.class) public class SchemaUpdateTest { @Parameterized.Parameters - public static Collection parameters() { + public static Collection parameters() { return Arrays.asList( - new String[] {JdbcMetadaAccessStrategy.GROUPED.toString(), JdbcMetadaAccessStrategy.INDIVIDUALLY.toString()} + new String[] { JdbcMetadaAccessStrategy.GROUPED.toString() }, + new String[] { JdbcMetadaAccessStrategy.INDIVIDUALLY.toString()} ); } diff --git a/hibernate-core/src/test/java/org/hibernate/test/schemavalidation/LongVarcharValidationTest.java b/hibernate-core/src/test/java/org/hibernate/test/schemavalidation/LongVarcharValidationTest.java index bd96d28c44..305d7c80ac 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/schemavalidation/LongVarcharValidationTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/schemavalidation/LongVarcharValidationTest.java @@ -46,9 +46,10 @@ import org.junit.runners.Parameterized; @RunWith(Parameterized.class) public class LongVarcharValidationTest implements ExecutionOptions { @Parameterized.Parameters - public static Collection parameters() { + public static Collection parameters() { return Arrays.asList( - new String[] {JdbcMetadaAccessStrategy.GROUPED.toString(), JdbcMetadaAccessStrategy.INDIVIDUALLY.toString()} + new String[] { JdbcMetadaAccessStrategy.GROUPED.toString() }, + new String[] { JdbcMetadaAccessStrategy.INDIVIDUALLY.toString() } ); } diff --git a/hibernate-core/src/test/java/org/hibernate/test/schemavalidation/SynonymValidationTest.java b/hibernate-core/src/test/java/org/hibernate/test/schemavalidation/SynonymValidationTest.java index befebb6fc8..8f3f44cd15 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/schemavalidation/SynonymValidationTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/schemavalidation/SynonymValidationTest.java @@ -18,6 +18,7 @@ import org.hibernate.boot.registry.StandardServiceRegistry; import org.hibernate.boot.registry.StandardServiceRegistryBuilder; import org.hibernate.cfg.AvailableSettings; import org.hibernate.dialect.Oracle9iDialect; +import org.hibernate.resource.transaction.spi.TransactionStatus; import org.hibernate.tool.hbm2ddl.SchemaValidator; import org.hibernate.tool.schema.JdbcMetadaAccessStrategy; @@ -51,7 +52,7 @@ public class SynonymValidationTest extends BaseNonConfigCoreFunctionalTestCase { s.getTransaction().commit(); } catch (Exception e) { - if ( s.getTransaction().isActive() ) { + if ( s.getTransaction().getStatus() == TransactionStatus.ACTIVE ) { s.getTransaction().rollback(); } } @@ -69,7 +70,7 @@ public class SynonymValidationTest extends BaseNonConfigCoreFunctionalTestCase { s.getTransaction().commit(); } catch (Exception e) { - if ( s.getTransaction().isActive() ) { + if ( s.getTransaction().getStatus() == TransactionStatus.ACTIVE ) { s.getTransaction().rollback(); } }