public T add(T e) {
		PreparedStatement ps = null;
		ResultSet rs = null;

		try {
			ps =  getPreparedStatement(getInsertSQL());
			e.setId(getPrimaryKeyId());
			ps.setInt(1, e.getId());
			fillInStatement(ps, e, 2);
			ps.executeUpdate();
			rs = getGeneratedKey(ps);
			if(rs != null && rs.next()) {
				e.setId(rs.getInt(1));
			}
			
		} catch (SQLException ex) {
			log.log(Level.SEVERE, "add failed: " + ex.getMessage(), ex);
		} finally {
			try {
				if (rs != null) rs.close();
				if (ps != null) ps.close();
			} catch (SQLException es) {
				log.log(Level.WARNING, "failed to close db resources: " + es.getMessage(), es);
			}
		}
		
		return e;
	}