class BaseDaoImpl implements Dao<T, ID> {

	@Override
	public int update(T data) throws SQLException {
		checkForInitialized();
		// ignore updating a null object
		if (data == null) {
			return 0;
		}
		if (data instanceof BaseDaoEnabled) {
			@SuppressWarnings("unchecked")
			BaseDaoEnabled<T, ID> daoEnabled = (BaseDaoEnabled<T, ID>) data;
			daoEnabled.setDao(this);
		}
		DatabaseConnection connection = connectionSource.getReadWriteConnection(tableInfo.getTableName());
		try {
			return statementExecutor.update(connection, data, objectCache);
		} finally {
			connectionSource.releaseConnection(connection);
		}
	}

	protected  BaseDaoImpl(Class<T> dataClass);
	protected  BaseDaoImpl(ConnectionSource connectionSource, Class<T> dataClass);
	protected  BaseDaoImpl(ConnectionSource connectionSource, DatabaseTableConfig<T> tableConfig);
	private  BaseDaoImpl(ConnectionSource connectionSource, Class<T> dataClass, DatabaseTableConfig<T> tableConfig);

}