Hibernate: Load entities with Formula

前端 未结 1 1446
名媛妹妹
名媛妹妹 2021-01-16 09:58

Is it possible to load an entity using a Formula?

For example:

@formula(\"(select * from myEntity ent where ent.isLatest = TRUE )\")
publicmyEntity g         


        
相关标签:
1条回答
  • 2021-01-16 10:39

    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
    
    0 讨论(0)
提交回复
热议问题