hibernate/hibernate-orm · error · PropertyAccessBuildingException

Invalid access type " + propertyAccessType + " for property

Error message

Invalid access type " + propertyAccessType + " for property named [" + containerJavaType.getName() + "#" + propertyName + "]

What it means

Error "Invalid access type " + propertyAccessType + " for property named [" + containerJavaType.getName() + "#" + propertyName + "]" thrown in hibernate/hibernate-orm.

Source

Thrown at hibernate-core/src/main/java/org/hibernate/property/access/internal/PropertyAccessMixedImpl.java:69

				getter = fieldGetter( containerJavaType, propertyName, field );
				setter = fieldSetter( containerJavaType, propertyName, field );
				break;
			}
			case PROPERTY: {
				final var getterMethod = getterMethodOrNull( containerJavaType, propertyName );
				if ( getterMethod == null ) {
					throw new PropertyAccessBuildingException(
							"Could not locate getter for property named [" + containerJavaType.getName() + "#" + propertyName + "]"
					);
				}
				final var setterMethod = findSetterMethod( containerJavaType, propertyName, getterMethod.getReturnType() );

				getter = propertyGetter( containerJavaType, propertyName, getterMethod );
				setter = propertySetter( containerJavaType, propertyName, setterMethod );
				break;
			}
			default: {
				throw new PropertyAccessBuildingException(
						"Invalid access type " + propertyAccessType + " for property named [" + containerJavaType.getName() + "#" + propertyName + "]"
				);
			}
		}
	}

	// --- //

	private static Getter fieldGetter(Class<?> containerJavaType, String propertyName, Field field) {
		return new GetterFieldImpl( containerJavaType, propertyName, field );
	}

	private static Setter fieldSetter(Class<?> containerJavaType, String propertyName, Field field) {
		return new SetterFieldImpl( containerJavaType, propertyName, field );
	}

	private static Getter propertyGetter(Class<?> containerJavaType, String propertyName, Method method) {
		return new GetterMethodImpl( containerJavaType, propertyName, method );

View on GitHub (pinned to fad1729dce)

Solutions

  1. Use a valid access type ('field' or 'property') for the mixed-access property.
  2. Ensure @Access annotations are consistent across the hierarchy.

When it happens

Trigger: A runtime precondition of the Hibernate API is violated.

Common situations: Occurs when application code or configuration does not satisfy the documented contract of the API being called.


AI-assisted analysis of hibernate/hibernate-orm@fad1729dce (2026-08-22). Data as JSON: /api/errors/05fcbfc088e30998. Report an issue: GitHub.