Skip to content

Commit

Permalink
HHH-15888 clean up exception reporting in Column
Browse files Browse the repository at this point in the history
- and generally tidy up that class a bit
- make state management in Column safer using assertions
- fix minor potential bug spotted by CodeQL
  • Loading branch information
gavinking committed Dec 27, 2022
1 parent 109dac9 commit b0479c5
Show file tree
Hide file tree
Showing 7 changed files with 191 additions and 197 deletions.
Expand Up @@ -105,7 +105,7 @@ public void bindColumn(
SimpleValue simpleValue,
boolean areColumnsNullableByDefault,
ColumnNamingDelegate columnNamingDelegate) {
Table table = simpleValue.getTable();
final Table table = simpleValue.getTable();

final Column column = new Column();
column.setValue( simpleValue );
Expand Down
Expand Up @@ -187,8 +187,6 @@ public static TemporaryTable createIdTable(
column.getText( dialect ),
jdbcMapping,
column.getSqlType(
runtimeModelCreationContext.getTypeConfiguration(),
dialect,
runtimeModelCreationContext.getMetadata()
),
column.getColumnSize(
Expand Down Expand Up @@ -234,8 +232,6 @@ public static TemporaryTable createIdTable(
column.getText( dialect ),
selection.getJdbcMapping(),
column.getSqlType(
runtimeModelCreationContext.getTypeConfiguration(),
dialect,
runtimeModelCreationContext.getMetadata()
),
column.getColumnSize(
Expand Down Expand Up @@ -289,8 +285,6 @@ public static TemporaryTable createEntityTable(
ENTITY_TABLE_IDENTITY_COLUMN,
jdbcMapping,
column.getSqlType(
runtimeModelCreationContext.getTypeConfiguration(),
dialect,
runtimeModelCreationContext.getMetadata()
) + " " +
dialect.getIdentityColumnSupport().getIdentityColumnString( column.getSqlTypeCode( runtimeModelCreationContext.getMetadata() ) ),
Expand Down Expand Up @@ -325,8 +319,6 @@ public static TemporaryTable createEntityTable(
column.getText( dialect ),
jdbcMapping,
column.getSqlType(
runtimeModelCreationContext.getTypeConfiguration(),
dialect,
runtimeModelCreationContext.getMetadata()
),
column.getColumnSize(
Expand All @@ -349,8 +341,6 @@ public static TemporaryTable createEntityTable(
discriminator.getText( dialect ),
discriminatorMapping.getJdbcMapping(),
discriminator.getSqlType(
runtimeModelCreationContext.getTypeConfiguration(),
dialect,
runtimeModelCreationContext.getMetadata()
),
discriminator.getColumnSize(
Expand Down Expand Up @@ -381,8 +371,6 @@ public static TemporaryTable createEntityTable(
selectable.getText( dialect ),
selection.getJdbcMapping(),
column.getSqlType(
runtimeModelCreationContext.getTypeConfiguration(),
dialect,
runtimeModelCreationContext.getMetadata()
),
column.getColumnSize(
Expand Down
Expand Up @@ -13,7 +13,6 @@
import org.hibernate.FetchMode;
import org.hibernate.MappingException;
import org.hibernate.boot.model.relational.Database;
import org.hibernate.boot.spi.MetadataBuildingContext;
import org.hibernate.engine.spi.Mapping;
import org.hibernate.internal.util.collections.ArrayHelper;
import org.hibernate.mapping.Column;
Expand Down

0 comments on commit b0479c5

Please sign in to comment.