{"record":{"id":"5a15e00b3e19e5f0","repo":"hibernate/hibernate-orm","slug":"not-an-embeddable-clsname","errorCode":null,"errorMessage":"Not an embeddable: ${clsName}","messagePattern":"Not an embeddable: (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/metamodel/model/domain/internal/JpaMetamodelImpl.java","lineNumber":300,"sourceCode":"\t\t\tthrow new IllegalArgumentException( \"Not an entity: \" + cls.getName() );\n\t\t}\n\t\treturn entityType;\n\t}\n\n\t@Override\n\tpublic @Nullable <X> EmbeddableDomainType<X> findEmbeddableType(Class<X> cls) {\n\t\treturn checkDomainType( cls, managedTypeByClass.get( cls ) )\n\t\t\t\t\tinstanceof EmbeddableDomainType<X> embeddableDomainType\n\t\t\t\t? embeddableDomainType\n\t\t\t\t: null;\n\t}\n\n\t@Override\n\t@Nonnull\n\tpublic <X> EmbeddableDomainType<X> embeddable(@Nonnull Class<X> cls) {\n\t\tfinal var embeddableType = findEmbeddableType( cls );\n\t\tif ( embeddableType == null ) {\n\t\t\tthrow new IllegalArgumentException( \"Not an embeddable: \" + cls.getName() );\n\t\t}\n\t\treturn embeddableType;\n\t}\n\n\tprivate Collection<ManagedDomainType<?>> getAllManagedTypes() {\n\t\t// should never happen\n\t\treturn switch ( jpaMetaModelPopulationSetting ) {\n\t\t\tcase IGNORE_UNSUPPORTED -> managedTypeByClass.values();\n\t\t\tcase ENABLED -> managedTypeByName.values();\n\t\t\tcase DISABLED -> emptySet();\n\t\t};\n\t}\n\n\t@Override\n\t@Nonnull\n\tpublic Set<ManagedType<?>> getManagedTypes() {\n\t\treturn new HashSet<>( getAllManagedTypes() );\n\t}","sourceCodeStart":282,"sourceCodeEnd":318,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/metamodel/model/domain/internal/JpaMetamodelImpl.java#L282-L318","documentation":"Error \"Not an embeddable: ${clsName}\" thrown in hibernate/hibernate-orm.","triggerScenarios":"Thrown when embeddable() is called with a Class that is not a mapped embeddable class.","commonSituations":"See trigger scenarios.","solutions":["Pass an @Embeddable class that is part of the persistence unit."],"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"}