diff --git a/foundation/org.eclipse.persistence.core.test.framework/src/main/java/org/eclipse/persistence/testing/framework/TogglingFastTableCreator.java b/foundation/org.eclipse.persistence.core.test.framework/src/main/java/org/eclipse/persistence/testing/framework/TogglingFastTableCreator.java index 4c0ec270dc..c533008418 100644 --- a/foundation/org.eclipse.persistence.core.test.framework/src/main/java/org/eclipse/persistence/testing/framework/TogglingFastTableCreator.java +++ b/foundation/org.eclipse.persistence.core.test.framework/src/main/java/org/eclipse/persistence/testing/framework/TogglingFastTableCreator.java @@ -286,14 +286,40 @@ protected static FieldDefinition createNumericColumn( /** * Helper method to create {@link FieldDefinition} instance for numeric column - * with given name to store float or double type values. + * with given name to store float type values. + * @param name Column name. + * @param allowNull Allow {@code null} values for column. + * @return Initialized {@link FieldDefinition} instance. + */ + protected static FieldDefinition createFloatColumn( + final String name, final boolean allowNull) { + final FieldDefinition field = new FieldDefinition(); + field.setName(name); + field.setType(Float.class); + field.setShouldAllowNull(allowNull); + field.setIsPrimaryKey(false); + field.setUnique(false); + field.setIsIdentity(false); + return field; + } + + /** + * Helper method to create {@link FieldDefinition} instance for numeric column + * with given name to store double type values. * @param name Column name. * @param allowNull Allow {@code null} values for column. * @return Initialized {@link FieldDefinition} instance. */ protected static FieldDefinition createDoubleColumn( final String name, final boolean allowNull) { - return createNumericColumn(name, 19, 4, allowNull); + final FieldDefinition field = new FieldDefinition(); + field.setName(name); + field.setType(Double.class); + field.setShouldAllowNull(allowNull); + field.setIsPrimaryKey(false); + field.setUnique(false); + field.setIsIdentity(false); + return field; } /** diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.advanced/src/main/java/org/eclipse/persistence/testing/models/jpa/advanced/entities/EntityFloat.java b/jpa/eclipselink.jpa.testapps/jpa.test.advanced/src/main/java/org/eclipse/persistence/testing/models/jpa/advanced/entities/EntityFloat.java index 7a39f7911a..be4d446abe 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.advanced/src/main/java/org/eclipse/persistence/testing/models/jpa/advanced/entities/EntityFloat.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.advanced/src/main/java/org/eclipse/persistence/testing/models/jpa/advanced/entities/EntityFloat.java @@ -22,8 +22,6 @@ import org.eclipse.persistence.sessions.Session; import org.eclipse.persistence.sessions.UnitOfWork; import org.eclipse.persistence.testing.framework.TogglingFastTableCreator; -import org.eclipse.persistence.testing.models.jpa.advanced.Employee; -import org.eclipse.persistence.tools.schemaframework.PopulationManager; import org.eclipse.persistence.tools.schemaframework.TableDefinition; // Based on reproduction scenario from issue #2301 (https://github.com/eclipse-ee4j/eclipselink/issues/2301) @@ -132,9 +130,9 @@ public static TableDefinition buildTable() { TableDefinition table = new TableDefinition(); table.setName(TABLE_NAME); table.addField(createNumericPk("ID", 10)); - table.addField(createDoubleColumn("HEIGHT", false)); - table.addField(createDoubleColumn("LENGTH", false)); - table.addField(createDoubleColumn("WIDTH", false)); + table.addField(createFloatColumn("HEIGHT", false)); + table.addField(createFloatColumn("LENGTH", false)); + table.addField(createFloatColumn("WIDTH", false)); table.addField(createStringColumn("DESCRIPTION", 255,false)); return table; }