Ignore Hibernate @Where annotation

后端 未结 5 1840
孤独总比滥情好
孤独总比滥情好 2020-12-17 10:05

I have an Entity which has an association to another Entity annotated with @Where, like so

public class EntityA {

    @OneToMany
    @Where(...)
    private         


        
5条回答
  •  北荒
    北荒 (楼主)
    2020-12-17 10:38

    I just had the same question. I solved the problem like this:

    @Query(value="SELECT * FROM EntityA", nativeQuery=true)
    public ignoreWhereMethod(){}
    

    The SQL in the @Query annotation must point the table's name and the fields' names (not entity's name).

提交回复
热议问题