uniqueCode = RandomStringUtils.randomAlphanumeric(13);
String sql = "SELECT COUNT(*) FROM "+quoteTable("affiliate")+" WHERE code=?";
count = getJdbcOperations().queryForObject(sql, Integer.class, uniqueCode);
}while(count>0);
AffiliateForm form = new AffiliateForm();
form.setCode(uniqueCode);
return form;
}