JPA one-to-many filtering

前端 未结 4 1915
遇见更好的自我
遇见更好的自我 2021-02-05 05:20

We are nesting several entities. However upon retrieving we only want to get those entities which are active.

@Entity
public class System {
  @Id
  @Column(name          


        
4条回答
  •  春和景丽
    2021-02-05 06:08

    AFAIK there is no portable JPA-based way to do this. A clean, however a little bit inefficient, solution would be to do everything on Java-side and create a getter getActiveSystemproperties() that manually iterates over mapped systempropertys and returns an immutable set of active properties.

提交回复
热议问题