{"record":{"id":"4192cc13cd8ba7ac","repo":"hibernate/hibernate-orm","slug":"not-implemented-yet-decide-how-to-handle","errorCode":null,"errorMessage":"Not implemented yet - decide how to handle","messagePattern":"Not implemented yet - decide how to handle","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/engine/FetchTiming.java","lineNumber":29,"sourceCode":" *\n * @author Steve Ebersole\n * @see FetchStyle\n */\npublic enum FetchTiming {\n\t/**\n\t * Perform fetching immediately.  Also called eager fetching\n\t */\n\tIMMEDIATE,\n\t/**\n\t * Performing fetching later, when needed.  Also called lazy fetching.\n\t */\n\tDELAYED;\n\n\tpublic static FetchTiming forType(FetchType type) {\n\t\treturn switch (type) {\n\t\t\tcase EAGER -> IMMEDIATE;\n\t\t\tcase LAZY -> DELAYED;\n\t\t\tcase DEFAULT -> throw new UnsupportedOperationException( \"Not implemented yet - decide how to handle\" );\n\t\t};\n\t}\n}\n","sourceCodeStart":11,"sourceCodeEnd":33,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/engine/FetchTiming.java#L11-L33","documentation":"FetchTiming.forType maps a JPA FetchType to Hibernate's internal fetch timing: EAGER to IMMEDIATE, LAZY to DELAYED. FetchType.DEFAULT - the value present when a fetch type is omitted - has no mapping, so the switch throws UnsupportedOperationException('Not implemented yet - decide how to handle'). The single production caller is FetchProfileHelper.createFetchProfile, which runs while the SessionFactory is built, so a fetch-profile definition whose fetch override still carries DEFAULT fails at startup.","triggerScenarios":"Defining a fetch profile (@FetchProfile with @FetchOverrides, or an XML fetch-profile) whose fetch override does not resolve to EAGER or LAZY - e.g. explicitly setting fetch = FetchType.DEFAULT or a mapping path that leaves the default in place. FetchProfileHelper calls FetchTiming.forType(mappingFetch.getType()) during factory init and the DEFAULT branch throws. Custom code calling FetchTiming.forType(FetchType.DEFAULT) directly hits the same wall.","commonSituations":"Migrating Hibernate 5 fetch-profile XML/annotations to Hibernate 6 where DEFAULT previously slipped through; generated mapping code that copies FetchType.DEFAULT from a defaulted annotation field; copy-pasted fetch-profile snippets missing the fetch attribute on some drivers of the annotation.","solutions":["Edit the fetch-profile definition to state the timing explicitly: fetch = FetchType.EAGER (or LAZY) on every @FetchOverrides entry / <fetch> element.","Remove the incomplete fetch override entirely if default fetching is what you want - profiles exist to override, so an entry with DEFAULT is meaningless anyway.","If your own code calls FetchTiming.forType, resolve DEFAULT to EAGER or LAZY before calling it.","Upgrade Hibernate - placeholder semantics for DEFAULT inside fetch profiles may be resolved in later 6.x releases."],"exampleFix":"// before - throws at SessionFactory bootstrap\n@FetchProfile(name = \"order-with-items\")\n@FetchOverrides({\n    @FetchOverride(entity = Order.class, association = \"items\",\n                   fetch = FetchType.DEFAULT)  // DEFAULT has no FetchTiming\n})\n// after\n@FetchProfile(name = \"order-with-items\")\n@FetchOverrides({\n    @FetchOverride(entity = Order.class, association = \"items\",\n                   fetch = FetchType.LAZY)\n})","handlingStrategy":"validation","validationCode":"// Scan fetch-profile definitions at build time so DEFAULT never reaches the bootstrap\nfor (var profile : metadata.getFetchProfiles()) {\n    for (var fetch : profile.getFetches()) {\n        if (fetch.getType() == FetchType.DEFAULT) {\n            throw new IllegalStateException(\"Fetch profile '\" + profile.getName()\n                + \"' must declare EAGER or LAZY, found DEFAULT on \" + fetch.getAssociation());\n        }\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always write an explicit fetch = FetchType.EAGER/LAZY in @FetchOverride entries.","If you call FetchTiming.forType yourself, resolve DEFAULT (e.g. to EAGER) before the call.","Fail fast in CI: build the SessionFactory in a smoke test so mapping errors surface before deployment."],"tags":["fetch-profile","fetch-type","mapping","bootstrap","lazy-loading"],"backgroundTag":"jpa-mapping-configuration","analyzedSha":"fad1729dce015f908198d57a8d80274a30f905a5","analyzedAt":"2026-08-22T04:13:57.527Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}