Static fields should be ignored when resolving property type via reflection

Description

Entity: (note the static field is not the property value holder)

Mapping:

Result:
Hibernate internally concludes the type of the property "intValue" is "java.lang.String", and for example creates a table where the column is of type varchar.

Code:
The debugging of this issue brought me to the following call stack:

The method PropertyAccessMixedImpl.getAccessType only checks for annotations on the field, but does not check whether or not the field is static, so for our "intValue" it concludes the access type should be FIELD, which seems wrong to me.

Environment

None

Status

Assignee

Chris Cranford

Reporter

Peter Gazdik

Fix versions

backPortable

None

Suitable for new contributors

Yes, likely

Requires Release Note

None

Pull Request

None

backportDecision

None

Worked in

4.3.11

Components

Affects versions

5.2.11

Priority

Major
Configure