Skip to content

Commit f872970

Browse files
committed
HBX-2881: Work around the removal of the methods 'Table#getIdentifierValue()' and 'Table#setIdentifierValue(KeyValue)'
Signed-off-by: Koen Aers <[email protected]>
1 parent f09d5c3 commit f872970

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

jbt/src/main/java/org/hibernate/tool/orm/jbt/internal/factory/TableWrapperFactory.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,11 @@ public boolean isPhysicalTable() {
136136

137137
@Override
138138
public ValueWrapper getIdentifierValue() {
139-
Value v = table.getIdentifierValue();
140-
return v == null ? null : ValueWrapperFactory.createValueWrapper(v);
139+
// Method 'Table#getIdentifierValue()' has been removed starting from Hibernate 7.0.0.Alpha3
140+
// TODO see JBIDE-29213
141+
// Value v = table.getIdentifierValue();
142+
// return v == null ? null : ValueWrapperFactory.createValueWrapper(v);
143+
return null;
141144
}
142145

143146

jbt/src/test/java/org/hibernate/tool/orm/jbt/api/wrp/TableWrapperTest.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,12 @@
1212
import java.util.Iterator;
1313
import java.util.List;
1414

15-
import org.hibernate.mapping.BasicValue;
1615
import org.hibernate.mapping.Column;
1716
import org.hibernate.mapping.ForeignKey;
18-
import org.hibernate.mapping.KeyValue;
1917
import org.hibernate.mapping.PrimaryKey;
2018
import org.hibernate.mapping.Table;
2119
import org.hibernate.tool.orm.jbt.internal.factory.ColumnWrapperFactory;
2220
import org.hibernate.tool.orm.jbt.internal.factory.TableWrapperFactory;
23-
import org.hibernate.tool.orm.jbt.internal.util.DummyMetadataBuildingContext;
2421
import org.junit.jupiter.api.BeforeEach;
2522
import org.junit.jupiter.api.Test;
2623

@@ -164,12 +161,14 @@ public void testIsPhysicalTable() {
164161
assertTrue(tableWrapper.isPhysicalTable());
165162
}
166163

164+
// Methods 'Table#getIdentifierValue()' and 'Table.setIdentifierValue(KeyValue)' were removed since Hibernate 7.0.0.Alpha3
165+
// TODO See JBIDE-29213
167166
@Test
168167
public void testGetIdentifierValue() {
169-
KeyValue value = new BasicValue(DummyMetadataBuildingContext.INSTANCE);
168+
// KeyValue value = new BasicValue(DummyMetadataBuildingContext.INSTANCE);
170169
assertNull(tableWrapper.getIdentifierValue());
171-
wrappedTable.setIdentifierValue(value);
172-
assertSame(value, tableWrapper.getIdentifierValue().getWrappedObject());
170+
// wrappedTable.setIdentifierValue(value);
171+
// assertSame(value, tableWrapper.getIdentifierValue().getWrappedObject());
173172
}
174173

175174
}

0 commit comments

Comments
 (0)