I’m using Hibernate 6.6.0.
The entity model:
@Entity
@Immutable
@Table(name = "reason")
public class Reason implements Serializable
{
@Id @Column(name = "reasonid", unique = true, insertable = false, updatable = false, nullable = false)
protected int reasonid;
@Column(name = "reasonnumber", insertable = false, updatable = false, nullable = false)
protected @NotNull String reasonnumber;
@Column(name = "text", insertable = false, updatable = false, nullable = false)
protected @NotNull String text;
@Column(name = "isactive", insertable = false, updatable = false, nullable = false)
protected boolean active;
@Column(name = "valid_from", insertable = false, updatable = false, nullable = false)
protected @NotNull LocalDate validFrom;
@Column(name = "valid_to", insertable = false, updatable = false, nullable = false)
protected @NotNull LocalDate validTo;
@Column(name = "special_feature", nullable = false, updatable = false, insertable = false)
@EnumBitmaskMap({
@Bitmask(bit = 0, name = "Ergebnis_LE")
})
protected @NotNull Set<ReasonSpecialFeature> specialFeatures;
}
What Hibernate tries to do:
2024-10-21 16:04:52,407|DEBUG|50000000000015|196C3B74#2|317|JdbcSelectExecutorStandardImpl.java:318|org.hibernate.orm.sql.exec - Skipping reading Query result cache data: cache-enabled = false, cache-mode = IGNORE
2024-10-21 16:04:52,408|DEBUG|50000000000015|196C3B74#2|317|SqlStatementLogger.java:135|org.hibernate.SQL -
select
r1_0.reasonid,
r1_0.isactive,
r1_0.reasonnumber,
r1_0.special_feature,
r1_0.text,
r1_0.valid_from,
r1_0.valid_to
from
ismed_dev.reason r1_0
where
r1_0.reasonid=?
2024-10-21 16:04:52,476|DEBUG|50000000000015|196C3B74#2|317|NavigablePathMapToInitializer.java:76|org.hibernate.orm.results - Initializer list:
de.mdk.ismed.common.persistence.entity.ismed_dev.Reason -> EntityJoinedFetchInitializer(de.mdk.ismed.common.persistence.entity.ismed_dev.Reason)@1359859178 (SingleTableEntityPersister(de.mdk.ismed.common.persistence.entity.ismed_dev.Reason))
The exception:
2024-10-21 16:04:52,476|DEBUG|50000000000015|196C3B74#2|317|SqlExceptionHelper.java:134|org.hibernate.engine.jdbc.spi.SqlExceptionHelper - Could not extract column [4] from JDBC ResultSet [n/a]
java.sql.SQLException: UngĂĽltiger Spaltentyp: getARRAY not implemented for class oracle.jdbc.driver.T4CNumberAccessor
at oracle.jdbc.driver.GeneratedAccessor.getARRAY(GeneratedAccessor.java:906) ~[ojdbc8.jar:19.3.0.0.0]
at oracle.jdbc.driver.GeneratedStatement.getARRAY(GeneratedStatement.java:343) ~[ojdbc8.jar:19.3.0.0.0]
at oracle.jdbc.driver.GeneratedScrollableResultSet.getARRAY(GeneratedScrollableResultSet.java:466) ~[ojdbc8.jar:19.3.0.0.0]
at oracle.jdbc.driver.GeneratedScrollableResultSet.getArray(GeneratedScrollableResultSet.java:87) ~[ojdbc8.jar:19.3.0.0.0]
at weblogic.jdbc.wrapper.ResultSet_oracle_jdbc_driver_ForwardOnlyResultSet.getArray(Unknown Source) ~[CodeGenerator.class:?]
at org.hibernate.dialect.OracleArrayJdbcType$2.doExtract(OracleArrayJdbcType.java:131) ~[hibernate-core-6.6.0.Final.jar:6.6.0.Final]
at org.hibernate.type.descriptor.jdbc.BasicExtractor.extract(BasicExtractor.java:44) ~[hibernate-core-6.6.0.Final.jar:6.6.0.Final]
at org.hibernate.sql.results.jdbc.internal.JdbcValuesResultSetImpl.getCurrentRowValue(JdbcValuesResultSetImpl.java:387) ~[hibernate-core-6.6.0.Final.jar:6.6.0.Final]
at org.hibernate.sql.results.internal.RowProcessingStateStandardImpl.getJdbcValue(RowProcessingStateStandardImpl.java:152) ~[hibernate-core-6.6.0.Final.jar:6.6.0.Final]
at org.hibernate.sql.results.graph.basic.BasicResultAssembler.extractRawValue(BasicResultAssembler.java:54) ~[hibernate-core-6.6.0.Final.jar:6.6.0.Final]
at org.hibernate.sql.results.graph.basic.BasicResultAssembler.assemble(BasicResultAssembler.java:60) ~[hibernate-core-6.6.0.Final.jar:6.6.0.Final]
at org.hibernate.sql.results.graph.entity.internal.EntityInitializerImpl.extractConcreteTypeStateValues(EntityInitializerImpl.java:1492) ~[hibernate-core-6.6.0.Final.jar:6.6.0.Final]
at org.hibernate.sql.results.graph.entity.internal.EntityInitializerImpl.initializeEntityInstance(EntityInitializerImpl.java:1229) ~[hibernate-core-6.6.0.Final.jar:6.6.0.Final]
at org.hibernate.sql.results.graph.entity.internal.EntityInitializerImpl.initializeInstance(EntityInitializerImpl.java:1208) ~[hibernate-core-6.6.0.Final.jar:6.6.0.Final]
at org.hibernate.sql.results.graph.entity.internal.EntityInitializerImpl.initializeInstance(EntityInitializerImpl.java:94) ~[hibernate-core-6.6.0.Final.jar:6.6.0.Final]
at org.hibernate.sql.results.internal.StandardRowReader.coordinateInitializers(StandardRowReader.java:244) ~[hibernate-core-6.6.0.Final.jar:6.6.0.Final]
at org.hibernate.sql.results.internal.StandardRowReader.readRow(StandardRowReader.java:141) ~[hibernate-core-6.6.0.Final.jar:6.6.0.Final]
at org.hibernate.sql.results.spi.ListResultsConsumer.readUniqueAssert(ListResultsConsumer.java:262) ~[hibernate-core-6.6.0.Final.jar:6.6.0.Final]
at org.hibernate.sql.results.spi.ListResultsConsumer.consume(ListResultsConsumer.java:198) ~[hibernate-core-6.6.0.Final.jar:6.6.0.Final]
at org.hibernate.sql.results.spi.ListResultsConsumer.consume(ListResultsConsumer.java:35) ~[hibernate-core-6.6.0.Final.jar:6.6.0.Final]
at org.hibernate.sql.exec.internal.JdbcSelectExecutorStandardImpl.doExecuteQuery(JdbcSelectExecutorStandardImpl.java:224) ~[hibernate-core-6.6.0.Final.jar:6.6.0.Final]
at org.hibernate.sql.exec.internal.JdbcSelectExecutorStandardImpl.executeQuery(JdbcSelectExecutorStandardImpl.java:102) ~[hibernate-core-6.6.0.Final.jar:6.6.0.Final]
at org.hibernate.sql.exec.spi.JdbcSelectExecutor.executeQuery(JdbcSelectExecutor.java:91) ~[hibernate-core-6.6.0.Final.jar:6.6.0.Final]
at org.hibernate.sql.exec.spi.JdbcSelectExecutor.list(JdbcSelectExecutor.java:165) ~[hibernate-core-6.6.0.Final.jar:6.6.0.Final]
at org.hibernate.loader.ast.internal.SingleIdLoadPlan.load(SingleIdLoadPlan.java:145) ~[hibernate-core-6.6.0.Final.jar:6.6.0.Final]
at org.hibernate.loader.ast.internal.SingleIdLoadPlan.load(SingleIdLoadPlan.java:117) ~[hibernate-core-6.6.0.Final.jar:6.6.0.Final]
at org.hibernate.loader.ast.internal.SingleIdEntityLoaderStandardImpl.load(SingleIdEntityLoaderStandardImpl.java:74) ~[hibernate-core-6.6.0.Final.jar:6.6.0.Final]
at org.hibernate.persister.entity.AbstractEntityPersister.doLoad(AbstractEntityPersister.java:3777) ~[hibernate-core-6.6.0.Final.jar:6.6.0.Final]
at org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:3766) ~[hibernate-core-6.6.0.Final.jar:6.6.0.Final]
at org.hibernate.event.internal.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:604) ~[hibernate-core-6.6.0.Final.jar:6.6.0.Final]
at org.hibernate.event.internal.DefaultLoadEventListener.loadFromCacheOrDatasource(DefaultLoadEventListener.java:590) ~[hibernate-core-6.6.0.Final.jar:6.6.0.Final]
at org.hibernate.event.internal.DefaultLoadEventListener.load(DefaultLoadEventListener.java:560) ~[hibernate-core-6.6.0.Final.jar:6.6.0.Final]
at org.hibernate.event.internal.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:544) ~[hibernate-core-6.6.0.Final.jar:6.6.0.Final]
at org.hibernate.event.internal.DefaultLoadEventListener.load(DefaultLoadEventListener.java:206) ~[hibernate-core-6.6.0.Final.jar:6.6.0.Final]
at org.hibernate.event.internal.DefaultLoadEventListener.loadWithRegularProxy(DefaultLoadEventListener.java:289) ~[hibernate-core-6.6.0.Final.jar:6.6.0.Final]
at org.hibernate.event.internal.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:241) ~[hibernate-core-6.6.0.Final.jar:6.6.0.Final]
at org.hibernate.event.internal.DefaultLoadEventListener.doOnLoad(DefaultLoadEventListener.java:110) ~[hibernate-core-6.6.0.Final.jar:6.6.0.Final]
at org.hibernate.event.internal.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:69) ~[hibernate-core-6.6.0.Final.jar:6.6.0.Final]
at org.hibernate.event.service.internal.EventListenerGroupImpl.fireEventOnEachListener(EventListenerGroupImpl.java:138) ~[hibernate-core-6.6.0.Final.jar:6.6.0.Final]
at org.hibernate.internal.SessionImpl.fireLoadNoChecks(SessionImpl.java:1229) ~[hibernate-core-6.6.0.Final.jar:6.6.0.Final]
at org.hibernate.internal.SessionImpl.internalLoad(SessionImpl.java:1075) ~[hibernate-core-6.6.0.Final.jar:6.6.0.Final]
at org.hibernate.sql.results.graph.entity.internal.EntitySelectFetchInitializer.initialize(EntitySelectFetchInitializer.java:236) ~[hibernate-core-6.6.0.Final.jar:6.6.0.Final]
at org.hibernate.sql.results.graph.entity.internal.EntitySelectFetchInitializer.resolveInstance(EntitySelectFetchInitializer.java:153) ~[hibernate-core-6.6.0.Final.jar:6.6.0.Final]
at org.hibernate.sql.results.graph.entity.internal.EntitySelectFetchInitializer.resolveInstance(EntitySelectFetchInitializer.java:44) ~[hibernate-core-6.6.0.Final.jar:6.6.0.Final]
at org.hibernate.sql.results.internal.StandardRowReader.coordinateInitializers(StandardRowReader.java:239) ~[hibernate-core-6.6.0.Final.jar:6.6.0.Final]
at org.hibernate.sql.results.internal.StandardRowReader.readRow(StandardRowReader.java:141) ~[hibernate-core-6.6.0.Final.jar:6.6.0.Final]
at org.hibernate.internal.ScrollableResultsImpl.prepareCurrentRow(ScrollableResultsImpl.java:133) ~[hibernate-core-6.6.0.Final.jar:6.6.0.Final]
at org.hibernate.internal.ScrollableResultsImpl.next(ScrollableResultsImpl.java:52) ~[hibernate-core-6.6.0.Final.jar:6.6.0.Final]
at org.hibernate.query.internal.ScrollableResultsIterator.hasNext(ScrollableResultsIterator.java:33) ~[hibernate-core-6.6.0.Final.jar:6.6.0.Final]
at java.util.Iterator.forEachRemaining(Iterator.java:132) ~[?:?]
at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801) ~[?:?]
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484) ~[?:?]
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474) ~[?:?]
at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913) ~[?:?]
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:?]
at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578) ~[?:?]
at de.mdk.ismed.gui.service.valuelist.ValueListLoaderService.load(ValueListLoaderService.java:155) ~[ismed3-gui-services.jar:6.0]
From the stack trace you can see that Hibernate associated OracleArrayJdbcType
with the attribute I explicitly binded to something else. The bind method of the AttributeBinder
is executed but the explicit type accessor settings on the BasicValue
are ignored.