{"record":{"id":"7e75b1eac08b3882","repo":"hibernate/hibernate-orm","slug":"could-not-locate-getter-for-property-named-co-7e75b1","errorCode":null,"errorMessage":"Could not locate getter for property named [\" + containerJavaType.getName() + \"#\" + propertyName + \"]","messagePattern":"Could not locate getter for property named \\[\" \\+ containerJavaType\\.getName\\(\\) \\+ \"#\" \\+ propertyName \\+ \"\\]","errorType":"exception","errorClass":"PropertyAccessBuildingException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/property/access/internal/PropertyAccessGetterImpl.java","lineNumber":51,"sourceCode":"\tpublic PropertyAccessGetterImpl(PropertyAccessStrategy strategy, Class<?> containerJavaType, String propertyName) {\n\t\tthis.strategy = strategy;\n\n\t\tfinal var propertyAccessType = getAccessType( containerJavaType, propertyName );\n\t\tswitch ( propertyAccessType ) {\n\t\t\tcase FIELD: {\n\t\t\t\tfinal var field = fieldOrNull( containerJavaType, propertyName );\n\t\t\t\tif ( field == null ) {\n\t\t\t\t\tthrow new PropertyAccessBuildingException(\n\t\t\t\t\t\t\t\"Could not locate field for property named [\" + containerJavaType.getName() + \"#\" + propertyName + \"]\"\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tgetter = fieldGetter( containerJavaType, propertyName, field );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase PROPERTY: {\n\t\t\t\tfinal var getterMethod = getterMethodOrNull( containerJavaType, propertyName );\n\t\t\t\tif ( getterMethod == null ) {\n\t\t\t\t\tthrow new PropertyAccessBuildingException(\n\t\t\t\t\t\t\t\"Could not locate getter for property named [\" + containerJavaType.getName() + \"#\" + propertyName + \"]\"\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tgetter = propertyGetter( containerJavaType, propertyName, getterMethod );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\tthrow new PropertyAccessBuildingException(\n\t\t\t\t\t\t\"Invalid access type \" + propertyAccessType + \" for property named [\" + containerJavaType.getName() + \"#\" + propertyName + \"]\"\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\t// --- //\n\n\tprivate static Getter fieldGetter(Class<?> containerJavaType, String propertyName, Field field) {\n\t\treturn new GetterFieldImpl( containerJavaType, propertyName, field );","sourceCodeStart":33,"sourceCodeEnd":69,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/property/access/internal/PropertyAccessGetterImpl.java#L33-L69","documentation":"Error \"Could not locate getter for property named [\" + containerJavaType.getName() + \"#\" + propertyName + \"]\" thrown in hibernate/hibernate-orm.","triggerScenarios":"A name referenced in a mapping, query, or configuration cannot be resolved at runtime.","commonSituations":"Typos in entity/attribute/mapping names, missing mappings, or refactoring without updating references.","solutions":["Add a getter method matching JavaBean naming (getX/isX) for the property on the class.","Check that the property name in the mapping matches the actual field/getter name."],"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"}