Immutable @Entity with @Computed fields requires two different constructors

Description

Given the following entity:

The mapper throws the following compile time error:

Updating the constructor to:

allows the mapper to generate the classes, however the EntityHelper generated get method expects the 5 argument constructor


Looking at the mapper-processor code, the EntityGetMethodGenerator is using EntityDefinition#getAllValues while the validateConstructor method of DefaultEntityFactory calls validateAllColumnsConstructor with only EntityDefinition#getAllColumns.


Current workaround is to define both constructors.

Environment

None

Pull Requests

None

Activity

Show:
Alexandre Dutra
December 24, 2020, 4:08 PM

thank you for reporting this. With the fix I’m proposing, the right constructor to declare is the one containing computed values:

Fixed

Assignee

Alexandre Dutra

Reporter

Erik Kringen

Labels

None

PM Priority

None

Reproduced in

4.9.0

Affects versions

None

Fix versions

Pull Request

None

Doc Impact

None

Size

None

External issue ID

None

External issue ID

None

Components

Priority

Minor
Configure