can I perform a query inside of JPA entity to get back a single column

前端 未结 2 1804
自闭症患者
自闭症患者 2021-01-25 17:42

I have a dumb question. It would be great if this could be done, but I am not holding my breath.

I need a single column from a table linked to my JPA entity to be a c

2条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-25 18:25

    @ElementCollection(fetch=FetchType.EAGER)
            @CollectionTable(name="QUICK_LAUNCH_DISTLIST",joinColumns=@JoinColumn(name="QUICK_LAUNCH_ID"))
            @Column(name="LIST_ID")
    private List distListIDs;
    

    The ElementCollection attribute is what I was looking for. It seems to work pretty well in addition to that.

    Thanks for the help and inspiration guys.

提交回复
热议问题