You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The idea is to allow a user to define a concrete class as entity view like this
@EntityView(MyEntity.class)
public class MyView {
private final Long id;
private final String name;
public MyView(@IdMapping("id") Long id, @Mapping("name") String name) {
this.id = id;
this.name = name;
}
// Getter + Setter + equals/hashCode
}
We will need to cleanup some of our expectations that an entity view can be cast to EntityViewProxy. We should also think about allowing @IdMapping on a parameter or maybe include an attribute id in the @EntityView annotation as we need that to be able to support collections.
It would be great if we can somehow treat the parameters like method attributes to support filters and sorting. An important thing here is that we should order attributes according to their attribute index.
The grand goal is to support Java 14 records, but being able to use Lombok data classes should also be possible IMO. Maybe it's enough to introduce a new annotation reader for such classes? A RecordAnnotationReader would build the ViewMapping based on the the record components. A DataClassAnnotationReader would read the bytecode of the constructor and infer the matching fields/methods for the parameters.
I'm scheduling this for 1.5.0 now but I might defer it to 1.6.0 if this is very hard.
The text was updated successfully, but these errors were encountered:
The idea is to allow a user to define a concrete class as entity view like this
We will need to cleanup some of our expectations that an entity view can be cast to
EntityViewProxy
. We should also think about allowing@IdMapping
on a parameter or maybe include an attributeid
in the@EntityView
annotation as we need that to be able to support collections.It would be great if we can somehow treat the parameters like method attributes to support filters and sorting. An important thing here is that we should order attributes according to their attribute index.
The grand goal is to support Java 14 records, but being able to use Lombok data classes should also be possible IMO. Maybe it's enough to introduce a new annotation reader for such classes? A RecordAnnotationReader would build the ViewMapping based on the the record components. A DataClassAnnotationReader would read the bytecode of the constructor and infer the matching fields/methods for the parameters.
I'm scheduling this for 1.5.0 now but I might defer it to 1.6.0 if this is very hard.
The text was updated successfully, but these errors were encountered: