Hello,
As a new Hibernate, after days struggling, I fixed some errors in mapping and annotations. It is a very old applications, an entity contains multiple other entities, sometimes hard to identify a entity. The following exception says :
class org.hibernate.type.internal.BasicTypeImpl cannot be cast to class org.hibernate.type.BasicPluralType
Error occurred without execute a good SQL. I think it relates to entity settings, too vague. but show me the path. I tried to debug in vain.
Could somebody teach me, when Debug, is it possible to step into a function, Watch a Expressions, we can get the entity name?
Initial SessionFactory creation failed.java.lang.ClassCastException: class org.hibernate.type.internal.BasicTypeImpl cannot be cast to class org.hibernate.type.BasicPluralType (org.hibernate.type.internal.BasicTypeImpl and org.hibernate.type.BasicPluralType are in unnamed module of loader 'app')
java.lang.ClassCastException: class org.hibernate.type.internal.BasicTypeImpl cannot be cast to class org.hibernate.type.BasicPluralType (org.hibernate.type.internal.BasicTypeImpl and org.hibernate.type.BasicPluralType are in unnamed module of loader 'app')
at org.hibernate.type.descriptor.sql.internal.ArrayDdlTypeImpl.getCastTypeName(ArrayDdlTypeImpl.java:34)
at org.hibernate.sql.ast.spi.AbstractSqlAstTranslator.getCastTypeName(AbstractSqlAstTranslator.java:6992)
at org.hibernate.sql.ast.spi.AbstractSqlAstTranslator.visitCastTarget(AbstractSqlAstTranslator.java:6939)
at org.hibernate.sql.ast.tree.expression.CastTarget.accept(CastTarget.java:80)
at org.hibernate.sql.ast.spi.AbstractSqlAstTranslator.render(AbstractSqlAstTranslator.java:7073)
at org.hibernate.query.sqm.produce.function.internal.PatternRenderer.render(PatternRenderer.java:224)
at org.hibernate.query.sqm.produce.function.internal.PatternRenderer.render(PatternRenderer.java:159)
at org.hibernate.query.sqm.produce.function.internal.PatternRenderer.render(PatternRenderer.java:142)
at org.hibernate.dialect.function.CastFunction.render(CastFunction.java:76)
at org.hibernate.sql.ast.spi.AbstractSqlAstTranslator.renderCasted(AbstractSqlAstTranslator.java:5813)
at org.hibernate.dialect.OracleSqlAstTranslator.renderMergeSource(OracleSqlAstTranslator.java:695)
at org.hibernate.dialect.SqlAstTranslatorWithUpsert.renderMergeUsing(SqlAstTranslatorWithUpsert.java:92)
at org.hibernate.dialect.SqlAstTranslatorWithUpsert.renderUpsertStatement(SqlAstTranslatorWithUpsert.java:66)
at org.hibernate.dialect.SqlAstTranslatorWithUpsert.createMergeOperation(SqlAstTranslatorWithUpsert.java:36)
at org.hibernate.dialect.OracleDialect.createOptionalTableUpdateOperation(OracleDialect.java:1588)
at org.hibernate.sql.model.internal.OptionalTableUpdate.createMutationOperation(OptionalTableUpdate.java:144)
at org.hibernate.persister.entity.mutation.AbstractMutationCoordinator.createOperationGroup(AbstractMutationCoordinator.java:87)
at org.hibernate.persister.entity.mutation.UpdateCoordinatorStandard.buildStaticUpdateGroup(UpdateCoordinatorStandard.java:1663)
at org.hibernate.persister.entity.mutation.UpdateCoordinatorStandard.<init>(UpdateCoordinatorStandard.java:93)
at org.hibernate.persister.entity.mutation.MergeCoordinator.<init>(MergeCoordinator.java:23)
at org.hibernate.persister.entity.AbstractEntityPersister.buildMergeCoordinator(AbstractEntityPersister.java:3658)
at org.hibernate.persister.entity.AbstractEntityPersister.doLateInit(AbstractEntityPersister.java:3404)
at org.hibernate.persister.entity.AbstractEntityPersister.postInstantiate(AbstractEntityPersister.java:3690)
at org.hibernate.metamodel.model.domain.internal.MappingMetamodelImpl.finishInitialization(MappingMetamodelImpl.java:202)
at org.hibernate.internal.SessionFactoryImpl.initializeMappingModel(SessionFactoryImpl.java:371)
at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:300)
at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:457)
at com.eng.maris.utility.HibernateUtil.getSessionFactory(HibernateUtil.java:29)
at com.eng.maris.dao.AbstractDAO.<init>(AbstractDAO.java:79)
Thanks,
Eric