HHH-18136 remove Table.identifierValue which was just bad

Signed-off-by: Gavin King <gavin@hibernate.org>
This commit is contained in:
Gavin King 2024-05-17 16:53:34 +02:00
parent 7d3d17de4c
commit 371fe8f51c
6 changed files with 1 additions and 23 deletions

View File

@ -77,15 +77,13 @@ public class GeneratorBinder {
Map<String, IdentifierGeneratorDefinition> localGenerators) {
LOG.debugf( "#makeIdGenerator(%s, %s, %s, %s, ...)", id, property, generatorType, generatorName );
final Table table = id.getTable();
table.setIdentifierValue( id );
//generator settings
id.setIdentifierGeneratorStrategy( generatorType );
final Map<String,Object> parameters = new HashMap<>();
//always settable
parameters.put( PersistentIdentifierGenerator.TABLE, table.getName() );
parameters.put( PersistentIdentifierGenerator.TABLE, id.getTable().getName() );
if ( id.getColumnSpan() == 1 ) {
parameters.put( PersistentIdentifierGenerator.PK, id.getColumns().get(0).getName() );

View File

@ -800,8 +800,6 @@ public class ModelBinder {
identifierValue.setIdentifierGeneratorParameters( params );
}
identifierValue.getTable().setIdentifierValue( identifierValue );
if ( isNotEmpty( unsavedValue ) ) {
identifierValue.setNullValue( unsavedValue );
}

View File

@ -180,11 +180,6 @@ public class ExportableColumn extends Column {
public boolean isColumnUpdateable(int index) {
return true;
}
@Override
public MetadataBuildingContext getBuildingContext() {
return table.getIdentifierValue().getBuildingContext();
}
}
}

View File

@ -392,8 +392,6 @@ public abstract class SimpleValue implements KeyValue {
IdentifierGeneratorFactory identifierGeneratorFactory,
Dialect dialect,
RootClass rootClass) throws MappingException {
getTable().setIdentifierValue( this );
if ( generator == null ) {
if ( customIdGeneratorCreator != null ) {
generator = customIdGeneratorCreator.createGenerator(
@ -407,7 +405,6 @@ public abstract class SimpleValue implements KeyValue {
}
}
}
return generator;
}

View File

@ -63,7 +63,6 @@ public class Table implements Serializable, ContributableDatabaseObject {
* contains all columns, including the primary key
*/
private final Map<String, Column> columns = new LinkedHashMap<>();
private KeyValue idValue;
private PrimaryKey primaryKey;
private final Map<ForeignKeyKey, ForeignKey> foreignKeys = new LinkedHashMap<>();
private final Map<String, Index> indexes = new LinkedHashMap<>();
@ -692,14 +691,6 @@ public class Table implements Serializable, ContributableDatabaseObject {
return uniqueInteger;
}
public void setIdentifierValue(KeyValue idValue) {
this.idValue = idValue;
}
public KeyValue getIdentifierValue() {
return idValue;
}
@Deprecated(since = "6.2")
public void addCheckConstraint(String constraint) {
addCheck( new CheckConstraint( constraint ) );

View File

@ -228,7 +228,6 @@ class ColumnDefinitions {
return table.hasPrimaryKey()
&& table.getPrimaryKey().getColumnSpan() == 1
&& table.getPrimaryKey().getColumn( 0 ).isIdentity();
}
private static String normalize(String typeName) {