Hibernate @Where annotation will not apply to collection count query when EXTRA Lazy
<p>I got OneToMany mapping</p>

<pre><code>@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
@LazyCollection(LazyCollectionOption.EXTRA)
@OneToMany(mappedBy = "user")
@Where(clause = "is_del = 0")
private List&lt;MyEntity&gt; activities = Lists.newArrayList();
</code></pre>

<p>Access to this field will send bellow SQLs</p>

<pre><code>Hibernate: 
    select
        count(id) 
    from
        activity_info 
    where
        user_id =?



Hibernate: 
    select
        ...
    from
        activity_info activities0_ 
    inner join
        addr_info addrinfoen1_ 
            on activities0_.addr_info_id=addrinfoen1_.id 
    where
        (
            activities0_.is_del = 0
        ) 
        and activities0_.user_id=?
</code></pre>

<p>Due to the EXTRA lazy, access to <code>activities.size()</code> will only send the first query, the <code>@Where</code> condition has been <strong>ignored</strong>.</p>

<p>Is this a bug or am I wrong about this usage ?</p>