【发布时间】:2016-08-17 12:32:30
【问题描述】:
我确实有一种情况,我需要根据某些条件从三个不同的表中获取数据。 例如。
@Entity
class Order{
id;
type;
typeId;
@Join with boqTable to get the Boq Associated with if type == BOQ and id = typeId
@Join with customTable to get custom data associated if type == CUSTOM and id = typeId
}
我应该能够使用 Order 实体插入和更新子表。 我该如何使用 JPA/Hibernate.. 我搜索了很多,除了在服务级别手动执行而不是在实体模型处理之外,我找不到任何解决方案
【问题讨论】:
-
没有条件连接。