*/
@Override
public void writeCredit(CustomerCredit customerCredit) {
if (customerCredit.getId() == failOnFlush) {
// try to insert one with a duplicate ID
CustomerCredit newCredit = new CustomerCredit();
newCredit.setId(customerCredit.getId());
newCredit.setName(customerCredit.getName());
newCredit.setCredit(customerCredit.getCredit());
sessionFactory.getCurrentSession().save(newCredit);
} else {
sessionFactory.getCurrentSession().update(customerCredit);
}
}