Hi,

1. To validate the number of SQL statements, use this SQL Statement count
validator I explained in this article:

https://vladmihalcea.com/2014/02/01/how-to-detect-the-n-plus-one-query-problem-during-testing/

2. For Hibernate Criteria, I don't think you should bother since it will be
removed in the future and the fix might not be backported to older versions.

You could use the JPA Criteria instead.

Vlad

On Fri, Sep 22, 2017 at 5:34 PM, Thomas Reinhardt <tho...@reinhardt.com>
wrote:

>
> Hello Hibernate Team,
>
> is there a good way to check in a junit test which number of sql
> statements are generated ?
> I want to tackle some of the lazy loading/class enhancement issues and
> those need good tests of course.
>
> Somehow related: I have a (rather trivial) fix for HHH-7842 (Hibernate
> Criteria does not respect fetch mode, when alias is used). As this is
> related to the now deprecated Hibernate Criteria API is there any chance
> my fix gets accepted or should I spare my time?
>
>
> Thanks,
>      Thomas
> _______________________________________________
> hibernate-dev mailing list
> hibernate-dev@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/hibernate-dev
>
_______________________________________________
hibernate-dev mailing list
hibernate-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/hibernate-dev

Reply via email to