{"record":{"id":"1943709c6dd9a4aa","repo":"hibernate/hibernate-orm","slug":"unrecognized-jpa-schema-management-action-setting","errorCode":null,"errorMessage":"Unrecognized JPA schema management action setting: '%s'","messagePattern":"Unrecognized JPA schema management action setting: '(.+?)'","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/tool/schema/Action.java","lineNumber":282,"sourceCode":"\t\t\t}\n\t\t}\n\n\t\t// then check hbm2ddl names\n\t\tfor ( var action : values() ) {\n\t\t\tfinal String hbm2ddlName = action.getExternalHbm2ddlName();\n\t\t\tif ( hbm2ddlName != null && hbm2ddlName.equals( name ) ) {\n\t\t\t\treturn action;\n\t\t\t}\n\t\t}\n\n\t\t// lastly, look at the enum name\n\t\tfor ( var action : values() ) {\n\t\t\tif ( action.name().equals( name ) ) {\n\t\t\t\treturn action;\n\t\t\t}\n\t\t}\n\n\t\tthrow new IllegalArgumentException( \"Unrecognized JPA schema management action setting: '\" + value + \"'\" );\n\t}\n\n\tprivate static Action interpretJpaSchemaManagementAction(SchemaManagementAction action) {\n\t\treturn switch ( action ) {\n\t\t\tcase NONE -> NONE;\n\t\t\tcase CREATE -> CREATE_ONLY;\n\t\t\tcase DROP -> DROP;\n\t\t\tcase DROP_AND_CREATE -> CREATE;\n\t\t\tcase VALIDATE -> VALIDATE;\n\t\t\tcase POPULATE -> POPULATE;\n\t\t};\n\t}\n\n\t/**\n\t * Interpret the value of the old-school Hibernate configuration property\n\t * {@value org.hibernate.cfg.SchemaToolingSettings#HBM2DDL_AUTO} as an\n\t * instance of {@link Action}.\n\t *","sourceCodeStart":264,"sourceCodeEnd":300,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/tool/schema/Action.java#L264-L300","documentation":"Hibernate converts the JPA schema management action setting (jakarta.persistence.schema-generation.database-action) into an internal Action by matching legacy hbm2ddl aliases, then JPA external names, then enum constant names. A value matching none of them — a typo, an unsupported word, or an unresolved placeholder — ends in this IllegalArgumentException carrying the raw value.","triggerScenarios":"Action interpretation receiving strings like \"createonly\", \"Drop and Create\", \"refresh\", or a placeholder that was never substituted (\"${ddl.action}\"); none match a legacy alias, JPA external name, or enum name, so interpretation throws.","commonSituations":"Env-var or placeholder typos; mixing Hibernate's create-drop with JPA's drop-and-create vocabulary; Spring forwarding a misspelled spring.jpa.hibernate.ddl-auto value; ops templates with stray casing or punctuation.","solutions":["Use a supported value: none, create, create-only, drop, drop-only, create-drop, drop-and-create, validate, update (matching is case-insensitive and covers the JPA names).","Inspect the raw property for typos, whitespace, and unresolved ${placeholders} in persistence.xml, YAML, or environment variables, and fix it at the source."],"exampleFix":"# before\n<property name=\"jakarta.persistence.schema-generation.database-action\" value=\"create-drip\"/>\n\n# after\n<property name=\"jakarta.persistence.schema-generation.database-action\" value=\"drop-and-create\"/>","handlingStrategy":"validation","validationCode":"private static final Set<String> VALID_ACTIONS = Set.of(\n        \"none\", \"create\", \"create-only\", \"drop\", \"drop-only\",\n        \"create-drop\", \"drop-and-create\", \"validate\", \"update\");\n\nif (value != null) {\n    String token = value.toString().trim().toLowerCase(Locale.ROOT);\n    if (!VALID_ACTIONS.contains(token)) {\n        throw new IllegalStateException(\"Unsupported schema action: \" + value);\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Centralize schema-action tokens in one constants class used by all profiles.","Fail fast on unresolved ${placeholders} before they reach Hibernate.","Double-check the JPA name (drop-and-create) versus Hibernate's (create-drop) when copying config."],"tags":["hibernate","schema-generation","hbm2ddl","configuration","illegalargumentexception"],"backgroundTag":"invalid-schema-management-action","analyzedSha":"fad1729dce015f908198d57a8d80274a30f905a5","analyzedAt":"2026-08-22T04:13:57.527Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}