jasebell/AbstractFactoryDemo — Issue #1: Code Review :)
Author: johngirvin
Created: 2011-10-19 09:51:20+00:00
State: open

# PojotableDAO

## create

29-30: could you cache the datasource lookup? *DataSource* is thread safe IIRC.

34: *clearParameters* is unnecessary

40: you could set the id of the inserted object using *pstmt.getGeneratedKeys*

43-48: *pstmt.close()* could throw an exception and *c.close()* would never be called

## delete

61-62: could you cache the datasource/connection lookup?

66: *clearParameters* is unnecessary

72-77: *pstmt.close()* could throw an exception and *c.close()* would never be called

## load

91-92: could you cache the datasource lookup?

111-117: any of the *close()* calls could throw an exception and the later ones would never be called

## loadAll

132-133: could you cache the datasource lookup?

140-145: duplicates of 101-105 - consider having a "populate from result set" helper method?

152-158: any of the *close()* calls could throw an exception and the later ones would never be called

## update

171-172: could you cache the datasource lookup?

176: *clearParameters* is unnecessary

177-180: duplicates 35-38; consider a "create prepared statement from pojotable" helper method?

186-191: *pstmt.close()* could throw an exception and *c.close()* would never be called

# PojotableMngr

## createInstance

If the *loadClass* on line 20 fails, *mgr* will be null at line 26 and throw a NPE that isn't caught.