Open EugenMayer opened 1 year ago
We should try to use @IdMapping
and not @Mapping
@EntityView(AppleEntity.class)
@CreatableEntityView
abstract public class AppleCreateView extends AppleCreateDTO {
public AppleCreateView(
@IdMapping("id") Long id,
@Mapping("name") String name,
@Mapping("type") String type
) {
super(id, name, type);
}
}
to see if the *Impl
is generated properly.
We are trying to implement DTOs as a based for EntityViews for different reasons
Data
and just use the list of fields for the entity as copy&paste.For this, we do the following
Entity
IdView
Create / Update DTOs
Now our create/update views
The Problem with the above would be, that the EVM scanner will now not detect the getter/setter at all or just the
IdMapper
annotation (we cannot tell)` - this is one bug / we expected to work. It should most probably not matter if the getter/setter are implemented or abstract (which AFAIU might be issue here).To try to work around this issue we did
The problem now is, that the AP that generates the
AppleCreateViewImpl
will fail to generate the constructor for the above. it will add the following constructor to theImpl
I assume that the ID is always added as the default first parameter, no matter if it is already present. This means, the workaround cannot be compiled, while the one without
Mapping
will not validate.We used the docs
Could we discuss the vision / intend here. Thank you!