休眠:使用公式加载实体 [英] Hibernate: Load entities with Formula
本文介绍了休眠:使用公式加载实体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否有可能使用公式加载实体?
例如:
publicmyEntity getmyEntity()
{
return this.associatedPatientJournalEntries;
}
如果是这样,映射必须看起来如何。
另外,使用公式加载某些实体的替代方法是什么?
解决方案
,但公式看起来如下:
select ent from myEntity ent where ent.isLatest
另一种选择是,将
你的方法。
加载方法
Is it possible to load an entity using a Formula?
For example:
@formula("(select * from myEntity ent where ent.isLatest = TRUE )") publicmyEntity getmyEntity() { return this.associatedPatientJournalEntries; }
if so, how does the mapping have to look.
Also, what are alternatives to using formulas to load certain entities?
解决方案You can, but the formula looks:
select ent from myEntity ent where ent.isLatest
Another alternatives are,
mounting the entity in your method. post loading method
这篇关于休眠:使用公式加载实体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文