【发布时间】:2022-02-02 00:34:36
【问题描述】:
我有以下实体视图模型,我正在尝试将其从 spring 数据 @Projection 转换为 blaze @EntityView 等效项
@Projection(types = Car.class)
@EntityView(Car.class)
public interface CarEntityView {
String getMake();
String getModel();
Owner getOwner();
@Mapping("owner.id")
@Value("#{target.owner?.id}")
UUID getOwnerId();
@Mapping("owner <> null")
@Value("#{target.owner != null}")
boolean hasOwner();
}
下面布尔表达式的弹簧注释工作正常
@Value("#{target.owner != null}")
但我无法弄清楚等效 blaze 实体视图映射的语法,这似乎不起作用:
@Mapping("owner <> null")
映射这样的布尔表达式的正确方法是什么?
【问题讨论】:
标签: java jpa spring-data-jpa blaze-persistence