NPE in AbstractSQLQuery when no connection provided #22

trisberg opened this Issue Oct 5, 2011 · 1 comment


None yet
2 participants

trisberg commented Oct 5, 2011

If I create an SQLQuery without a connection like this

SQLQuery query = new SQLQueryImpl(new PostgresTemplates());

and later forget to clone with a connection I get and NPE when calling uniqueResults. Could you add a null check and throw a more informative exception alerting the user to the problem.

The exception I see is:
Exception in thread "main" java.lang.NullPointerException
at com.mysema.query.sql.AbstractSQLQuery.iterateSingle(
at com.mysema.query.sql.AbstractSQLQuery.iterate(
at com.mysema.query.sql.AbstractSQLQuery.iterate(
at com.mysema.query.sql.AbstractSQLQuery.uniqueResult(


This comment has been minimized.

Show comment
Hide comment

timowest Oct 23, 2011


Released in 2.2.4


timowest commented Oct 23, 2011

Released in 2.2.4

@timowest timowest closed this Oct 23, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment