{"record":{"id":"8f72ef77feaeeb5d","repo":"hibernate/hibernate-orm","slug":"unrecognized-unwrap-type-type-getname","errorCode":null,"errorMessage":"Unrecognized unwrap type [{type.getName()}]","messagePattern":"Unrecognized unwrap type \\[(.+?)\\]","errorType":"exception","errorClass":"PersistenceException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/query/internal/AbstractQuery.java","lineNumber":108,"sourceCode":"\t}\n\n\t@Override\n\t@Nonnull\n\tpublic final <X> X unwrap(Class<X> type) {\n\t\tif ( type.isInstance( this ) ) {\n\t\t\treturn type.cast( this );\n\t\t}\n\n\t\tif ( type == MutationOrSelectionQuery.class ) {\n\t\t\treturn type.cast( MutationOrSelectionQueryImpl.from( this ) );\n\t\t}\n\n\t\tfinal X unwrappedDelegate = unwrapDelegates( type );\n\t\tif ( unwrappedDelegate != null ) {\n\t\t\treturn unwrappedDelegate;\n\t\t}\n\n\t\tthrow new PersistenceException( \"Unrecognized unwrap type [\" + type.getName() + \"]\" );\n\t}\n\n\t// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\t// Execution\n\n\tprotected <R> R executeQuery(Supplier<? extends R> supplier) {\n\t\tfinal var fetchProfiles = beforeQueryHandlingFetchProfiles();\n\t\tboolean success = false;\n\t\ttry {\n\t\t\tfinal var result = supplier.get();\n\t\t\tsuccess = true;\n\t\t\treturn result;\n\t\t}\n\t\tcatch (IllegalQueryOperationException e) {\n\t\t\tthrow new IllegalStateException( e );\n\t\t}\n\t\tcatch (HibernateException he) {\n\t\t\tthrow getExceptionConverter().convert( he, getQueryOptions().getLockOptions() );","sourceCodeStart":90,"sourceCodeEnd":126,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/query/internal/AbstractQuery.java#L90-L126","documentation":"Error \"Unrecognized unwrap type [{type.getName()}]\" thrown in hibernate/hibernate-orm.","triggerScenarios":"An unsupported unwrap target type is requested: Unrecognized unwrap type [<value>]","commonSituations":"Calling Query.unwrap() with an interface the query does not implement.","solutions":["The requested unwrap type is not supported by this query. Use a supported unwrap target type (e.g. the Hibernate Query/SelectionQuery interface actually implemented)."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fad1729dce015f908198d57a8d80274a30f905a5","analyzedAt":"2026-08-22T04:13:57.527Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}