{"record":{"id":"a4a6c9aa7597ec5b","repo":"hibernate/hibernate-orm","slug":"value-function-on-non-map","errorCode":"VALUE_FUNCTION_ON_NON_MAP","errorMessage":"Strict JPA query language compliance was violated: use of value() function for non-Map type","messagePattern":"Strict JPA query language compliance was violated: use of value\\(\\) function for non-Map type","errorType":"exception","errorClass":"StrictJpaComplianceViolation","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/query/hql/internal/SemanticQueryBuilder.java","lineNumber":5990,"sourceCode":"\t\t\tif ( madeNested ) {\n\t\t\t\tqualifiedJoinPathConsumer.setNested( true );\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tmadeNested = false;\n\t\t}\n\t\tfinal var sqmPath = consumeDomainPath( ctx.path() );\n\t\tfinal boolean hasContinuation = ctx.getChildCount() == 5;\n\n\t\tfinal var referencedPathSource = sqmPath.getReferencedPathSource();\n\t\tfinal var firstNode = (TerminalNode) ctx.elementValueQuantifier().getChild(0);\n\t\tcheckPluralPath( sqmPath, referencedPathSource, firstNode );\n\n\t\tif ( getCreationOptions().useStrictJpaCompliance() ) {\n\t\t\tfinal var attribute = (PluralPersistentAttribute<?, ?, ?>) referencedPathSource;\n\t\t\tif ( attribute.getCollectionClassification() != CollectionClassification.MAP\n\t\t\t\t\t&& firstNode.getSymbol().getType() == HqlParser.VALUE ) {\n\t\t\t\tthrow new StrictJpaComplianceViolation( StrictJpaComplianceViolation.Type.VALUE_FUNCTION_ON_NON_MAP );\n\t\t\t}\n\t\t}\n\n\t\tSqmPath<?> result;\n\t\tif ( consumer instanceof QualifiedJoinPathConsumer qualifiedJoinPathConsumer ) {\n\t\t\tif ( madeNested && !hasContinuation ) {\n\t\t\t\t// Reset the nested state before consuming the terminal identifier\n\t\t\t\tqualifiedJoinPathConsumer.setNested( false );\n\t\t\t}\n\t\t\tconsumer.consumeIdentifier( CollectionPart.Nature.ELEMENT.getName(), false, !hasContinuation );\n\t\t\tresult = (SqmPath<?>) consumer.getConsumedPart();\n\t\t}\n\t\telse {\n\t\t\tresult = sqmPath.resolvePathPart( CollectionPart.Nature.ELEMENT.getName(), true, this );\n\t\t}\n\n\t\tif ( hasContinuation ) {\n\t\t\tif ( madeNested ) {","sourceCodeStart":5972,"sourceCodeEnd":6008,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/query/hql/internal/SemanticQueryBuilder.java#L5972-L6008","documentation":"Error \"Strict JPA query language compliance was violated: use of value() function for non-Map type\" thrown in hibernate/hibernate-orm.","triggerScenarios":"An HQL-specific construct is used while strict JPQL compliance is enabled: Strict JPA query language compliance was violated: use of value() function for non-Map type","commonSituations":"Applications running with hibernate.jpa.compliance.query=true (or JPA-compliance mode) that submit queries using Hibernate extensions such as collations, tuples/row value constructors, HQL collection functions (maxelement/elements/indices), value()/key() on non-Map types, or non-standard function calls without FUNCTION() syntax.","solutions":["value() is only valid for Map associations, and strict JPA compliance was violated. Use value() only on map-valued paths, or relax compliance."],"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"}