[BATCH-496] Added more descriptive error messages

This commit is contained in:
nebhale
2008-03-25 11:04:23 +00:00
parent 49b6ebe51e
commit 8b8288d8d8
4 changed files with 34 additions and 25 deletions

View File

@@ -31,11 +31,11 @@ import org.springframework.beans.factory.FactoryBean;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.util.Assert;
import org.springframework.util.StringUtils;
/**
* A {@link FactoryBean} that automates the creation of a
* {@link SimpleJobRepository}. Requires the user to describe what kind of
* database they are using.
* A {@link FactoryBean} that automates the creation of a {@link SimpleJobRepository}. Requires the
* user to describe what kind of database they are using.
*
* @author Ben Hale
* @author Lucas Ward
@@ -73,7 +73,9 @@ public class JobRepositoryFactoryBean implements FactoryBean, InitializingBean {
incrementerFactory = new DefaultDataFieldMaxValueIncrementerFactory(dataSource);
}
Assert.isTrue(incrementerFactory.isSupportedIncrementerType(databaseType), "Unsupported database type");
Assert.isTrue(incrementerFactory.isSupportedIncrementerType(databaseType), "'" + databaseType
+ "' is an unsupported database type. The supported database types are "
+ StringUtils.arrayToCommaDelimitedString(incrementerFactory.getSupportedIncrementerTypes()));
}
public Object getObject() throws Exception {