NamedQuery not return all values

Hi,

When I run a Query on Oracle SQL Developer it returns 387 rows.

The issue happens on my Java code, I’m iterating on results from NamedQuery but it has the size of 352.

Iterator itProc = session.getNamedQuery("QueryName")
                    .list()
                    .iterator();

I’ve also got the query from Hibernate showing it on Jboss console and I’ve run it on Oracle SQL Developer and it has returned the 387 rows.

Any idea on what is happening?

Thanks,
Davi

You need to activate the HIbernate logging and check what query Hibernate generates.

Also, if you use DISTINCT, duplicates will be removed from the output.

Thanks for the tip,

but in my case it was an error on configured schema on Hibernate.cfg.

Can be closed.

Regards,
Davi