Ignore Hibernate @Where annotation

后端 未结 5 1787
孤独总比滥情好
孤独总比滥情好 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:40

    You can map another property with same data like this:

    public class EntityA {
    
        @OneToMany
        @JoinColumn(name='theColumnName', insertable=false, updateable=false)
        private List entityBListReadOnly;
    
    }
    

    Important to set as updateable false and insertable falso to avoid consistency problems in your data!

提交回复
热议问题