{"record":{"id":"c4463ae7e4213e85","repo":"hibernate/hibernate-orm","slug":"unsupported-jakarta-persistence-sql-mappingelement","errorCode":null,"errorMessage":"Unsupported jakarta.persistence.sql.MappingElement type : {}","messagePattern":"Unsupported jakarta\\.persistence\\.sql\\.MappingElement type : (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/query/results/internal/jpa/JpaMappingHelper.java","lineNumber":91,"sourceCode":"\t\telse {\n\t\t\tthrow new IllegalArgumentException( \"Unsupported jakarta.persistence.sql.ResultSetMapping type : \" + jpaMapping.getClass().getName() );\n\t\t}\n\t}\n\n\tpublic static <T> MappingElementBuilder<T> toHibernateBuilder(\n\t\t\tjakarta.persistence.sql.MappingElement<T> jpaMapping,\n\t\t\tSessionFactoryImplementor sessionFactory) {\n\t\tif ( jpaMapping instanceof ColumnMapping<T> columnMapping ) {\n\t\t\treturn new ColumnBuilder<>( columnMapping, sessionFactory );\n\t\t}\n\t\telse if ( jpaMapping instanceof ConstructorMapping<T> constructorMapping ) {\n\t\t\treturn new ConstructorBuilder<>( constructorMapping, sessionFactory );\n\t\t}\n\t\telse if ( jpaMapping instanceof EntityMapping<T> entityMapping ) {\n\t\t\treturn new EntityBuilder<>( entityMapping, sessionFactory );\n\t\t}\n\t\telse {\n\t\t\tthrow new IllegalArgumentException( \"Unsupported jakarta.persistence.sql.MappingElement type : \" + jpaMapping.getClass().getName() );\n\t\t}\n\t}\n\n\tpublic static <T> jakarta.persistence.sql.ResultSetMapping<T> makeJpaMapping(\n\t\t\tClass<T> entityType,\n\t\t\tSessionFactoryImplementor sessionFactory) {\n\t\tvar entityDescriptor = sessionFactory.getMappingMetamodel().getEntityDescriptor( entityType );\n\t\tfinal EntityDiscriminatorMapping discriminatorMapping = entityDescriptor.getDiscriminatorMapping();\n\t\treturn entity(\n\t\t\t\tentityType,\n\t\t\t\tdiscriminatorMapping == null ? null : discriminatorMapping.getSelectableName(),\n\t\t\t\tcollectMemberMappings( entityType, entityDescriptor, sessionFactory )\n\t\t);\n\t}\n\n\tprivate static <T> MemberMapping<T>[] collectMemberMappings(\n\t\t\tClass<T> entityType,\n\t\t\tEntityMappingType entityTypeDescriptor,","sourceCodeStart":73,"sourceCodeEnd":109,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/query/results/internal/jpa/JpaMappingHelper.java#L73-L109","documentation":"Error \"Unsupported jakarta.persistence.sql.MappingElement type : {}\" thrown in hibernate/hibernate-orm.","triggerScenarios":"A runtime precondition of the Hibernate query API is violated: Unsupported jakarta.persistence.sql.MappingElement type : <value>","commonSituations":"Application code or configuration calls the query API in a way that violates its documented contract; the interpolated values in the message identify the offending input.","solutions":["The MappingElement type is not supported. Use a supported mapping element (EntityResult, ColumnResult, ...)."],"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"}