{"record":{"id":"d2d0e9959c262118","repo":"hibernate/hibernate-orm","slug":"value-must-be-a-string-or-boolean","errorCode":null,"errorMessage":"value must be a string or boolean: {}","messagePattern":"value must be a string or boolean: (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/jpa/internal/util/ConfigurationHelper.java","lineNumber":104,"sourceCode":"\t\t\treturn integer;\n\t\t}\n\t\telse if ( value instanceof String string ) {\n\t\t\treturn Integer.valueOf( string );\n\t\t}\n\t\telse {\n\t\t\tthrow new IllegalArgumentException( \"value must be a string or integer: \" + value );\n\t\t}\n\t}\n\n\tpublic static Boolean getBoolean(Object value) {\n\t\tif ( value instanceof Boolean bool ) {\n\t\t\treturn bool;\n\t\t}\n\t\telse if ( value instanceof String string ) {\n\t\t\treturn Boolean.valueOf( string );\n\t\t}\n\t\telse {\n\t\t\tthrow new IllegalArgumentException( \"value must be a string or boolean: \" + value );\n\t\t}\n\t}\n\n\tpublic static CacheMode getCacheMode(Object value) {\n\t\tif ( value == null ) {\n\t\t\treturn null;\n\t\t}\n\t\telse if ( value instanceof CacheMode cacheMode ) {\n\t\t\treturn cacheMode;\n\t\t}\n\t\telse {\n\t\t\treturn CacheMode.valueOf( value.toString().toUpperCase( Locale.ROOT ) );\n\t\t}\n\t}\n}\n","sourceCodeStart":86,"sourceCodeEnd":120,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/jpa/internal/util/ConfigurationHelper.java#L86-L120","documentation":"Error \"value must be a string or boolean: {}\" thrown in hibernate/hibernate-orm.","triggerScenarios":"Thrown at hibernate-core/src/main/java/org/hibernate/jpa/internal/util/ConfigurationHelper.java:104 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide the configuration value as a String or Boolean; convert other types before setting the property."],"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"}