{"record":{"id":"a46049f4c06b59a0","repo":"hibernate/hibernate-orm","slug":"value-must-be-a-string-or-integer","errorCode":null,"errorMessage":"value must be a string or integer: {}","messagePattern":"value must be a string or integer: (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/jpa/internal/util/ConfigurationHelper.java","lineNumber":92,"sourceCode":"\t}\n\n\tprivate static FlushMode getFlushMode(FlushModeType flushMode)  {\n\t\treturn switch ( flushMode ) {\n\t\t\tcase AUTO -> FlushMode.AUTO;\n\t\t\tcase COMMIT -> FlushMode.COMMIT;\n\t\t\tcase EXPLICIT ->  FlushMode.MANUAL;\n\t\t};\n\t}\n\n\tpublic static Integer getInteger(Object value) {\n\t\tif ( value instanceof Integer integer ) {\n\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;","sourceCodeStart":74,"sourceCodeEnd":110,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/jpa/internal/util/ConfigurationHelper.java#L74-L110","documentation":"Error \"value must be a string or integer: {}\" thrown in hibernate/hibernate-orm.","triggerScenarios":"Thrown at hibernate-core/src/main/java/org/hibernate/jpa/internal/util/ConfigurationHelper.java:92 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide the configuration value as a String or Integer; 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"}