jOOQ/jOOQ — pull request #2469 by dsdstudio (2013-05-19 15:53:59+00:00)
Title: AbstractResultQuery.fetchOneMap() Nullpointer Exception

hello, i have some problem.

My environment jOOQ 3.0.0 , mysql, empty table wn_module
point -> empty table fetchOneMap()

see my test code

@Test
public void connectionPoolTest() {
Connection conn = null;
try {
conn = ds.getConnection();
DSLContext create = DSL.using(conn, SQLDialect.MYSQL);
System.out.println(" result => " + create.select().from(DSL.tableByName("wn_module")).fetchOneMap());
} catch (SQLException e) {
logger.error(e.getMessage(), e);
} finally {
DBUtil.closeQuietly(conn);
}
}

Raise NPE(NullPointerException)

java.lang.NullPointerException
at org.jooq.impl.AbstractResultQuery.fetchOneMap(AbstractResultQuery.java:495)
at org.jooq.impl.SelectImpl.fetchOneMap(SelectImpl.java:1108)

Reason `fetchOne()` is null
Like this should be changed.

AbstractResultQuery.java(:557) (master branch)

@Override
public final Map fetchOneMap() {
R record = fetchOne();
return record == null ? null : record.intoMap();
}

I can't speak english very well ^^; sorry

regards, Bohyung kim