{"record":{"id":"009d835bee0a2dff","repo":"hibernate/hibernate-orm","slug":"error-applying-query-hint-s-s","errorCode":null,"errorMessage":"Error applying query hint '%s': %s","messagePattern":"Error applying query hint '(.+?)': (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/query/internal/AbstractCommonQueryContract.java","lineNumber":444,"sourceCode":"\tprotected void putIfNotNull(Map<String, Object> hints, String hintName, Object hintValue) {\n\t\tif ( hintValue != null ) {\n\t\t\thints.put( hintName, hintValue );\n\t\t}\n\t}\n\n\t@Override\n\t@Nonnull\n\tpublic CommonQueryContractImplementor setHint(@Nonnull String hintName, @Nullable Object value) {\n\t\ttry {\n\t\t\tif ( !applyHint( hintName, value ) ) {\n\t\t\t\tQUERY_MESSAGE_LOGGER.ignoringUnrecognizedQueryHint( hintName );\n\t\t\t}\n\t\t}\n\t\tcatch (IllegalArgumentException|IllegalStateException jpaExpected) {\n\t\t\tthrow jpaExpected;\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\tthrow new IllegalArgumentException(\n\t\t\t\t\t\"Error applying query hint '%s': %s\"\n\t\t\t\t\t\t\t.formatted( hintName, e.getMessage() ),\n\t\t\t\t\te\n\t\t\t);\n\t\t}\n\t\treturn this;\n\t}\n\n\t/**\n\t * This method takes responsibility to recognize all known hints\n\t * and collecting the values.\n\t * <p>\n\t * However, not all hints are valid for all types of queries which\n\t * is beyond the understanding of this context.\n\t * <p>\n\t * Hints which are always relevant are handled by directly applying\n\t * the corresponding option.  These include:<ul>\n\t *     <li>{@linkplain QueryOptions#getQueryFlushMode() flush mode}","sourceCodeStart":426,"sourceCodeEnd":462,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/query/internal/AbstractCommonQueryContract.java#L426-L462","documentation":"Error \"Error applying query hint '%s': %s\" thrown in hibernate/hibernate-orm.","triggerScenarios":"An invalid or inapplicable query hint is set: Error applying query hint '<value>': <value>","commonSituations":"Passing wrong-typed hint values, entity-graph hints that are neither named graphs nor parseable GraphParser strings, ProcedureCall-only hints on normal queries, or query-spaces hints on non-native queries.","solutions":["Applying the query hint failed. Verify the hint name is supported and its value has the expected type/format for that hint."],"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"}