{"record":{"id":"d9e6e02e3538b1b9","repo":"hibernate/hibernate-orm","slug":"anytype-support-has-not-yet-been-implemented","errorCode":null,"errorMessage":"AnyType support has not yet been implemented","messagePattern":"AnyType support has not yet been implemented","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal/MappingModelCreationHelper.java","lineNumber":1890,"sourceCode":"\t\t\t\t\tdeclaringType,\n\t\t\t\t\tdeclaringEntityPersister,\n\t\t\t\t\tpropertyAccess\n\t\t\t) );\n\n\t\t\tcreationProcess.registerForeignKeyPostInitCallbacks(\n\t\t\t\t\t\"To-one key - \" + navigableRole,\n\t\t\t\t\t() -> MappingModelCreationHelper.interpretToOneKeyDescriptor(\n\t\t\t\t\t\t\tattributeMapping,\n\t\t\t\t\t\t\tbootProperty,\n\t\t\t\t\t\t\t(ToOne) bootProperty.getValue(),\n\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\tcreationProcess\n\t\t\t\t\t)\n\t\t\t);\n\t\t\treturn attributeMapping;\n\t\t}\n\t\telse {\n\t\t\tthrow new UnsupportedOperationException( \"AnyType support has not yet been implemented\" );\n\t\t}\n\t}\n\n\tprivate static FetchTiming fetchTiming(Property bootProperty, ManagedMappingType declaringType, ToOne value, EntityPersister entityPersister, FetchStyle fetchStyle, AssociationType type, SessionFactoryImplementor sessionFactory) {\n\t\tfinal String role = declaringType.getNavigableRole().toString() + \".\" + bootProperty.getName();\n\t\tfinal boolean lazy = value.isLazy();\n\t\tif ( lazy && entityPersister.getBytecodeEnhancementMetadata().isEnhancedForLazyLoading() ) {\n\t\t\tif ( value.isUnwrapProxy() ) {\n\t\t\t\treturn determineFetchTiming( fetchStyle, type, lazy, role, sessionFactory );\n\t\t\t}\n\t\t\telse if ( value instanceof ManyToOne manyToOne && value.isNullable() && manyToOne.isIgnoreNotFound() ) {\n\t\t\t\treturn FetchTiming.IMMEDIATE;\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn determineFetchTiming( fetchStyle, type, lazy, role, sessionFactory );\n\t\t\t}\n\t\t}\n\t\telse if ( !lazy","sourceCodeStart":1872,"sourceCodeEnd":1908,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal/MappingModelCreationHelper.java#L1872-L1908","documentation":"Error \"AnyType support has not yet been implemented\" thrown in hibernate/hibernate-orm.","triggerScenarios":"Thrown when mapping model creation reaches an AnyType usage in a context where any-type support has not been implemented.","commonSituations":"See trigger scenarios.","solutions":["Avoid @Any mappings in this context (e.g. inside the affected model part); use a standard many-to-one or inheritance mapping instead."],"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"}