Lazy fetch not properly handled when annotation in @MappedSuperclass

Description

Values of a property annotated:

@Lob
@Basic(fetch = LAZY)
@Column(name = "Datos", columnDefinition = "text", updatable = false)

that resides in an abstract @MappedSuperclass are not properly handled. When retrieving the concrete entity, the property is correctly not read from DB (since it is annotated as lazy fetch). But when explicitly getting the value of the property of the entity, the DB read seems not to be properly triggered, and it always returns a null value.

This anomaly does not show when the lazy-fetch property is moved to the concrete children entities, in this case the value is lazily retrieved.

This schema worked properly in earlier versions (4.2.21.Final) and the instrumentation ant task.

Environment

hibernate-entity-manager:5.1.0.Final
hibernate-enhance-maven-plugin:5.1.0.Final
MS SQL Server 2008

Status

Assignee

Luis Barreiro

Reporter

V. Hortal

Fix versions

Labels

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Affects versions

5.1.0
5.0.9

Priority

Major